{"id":3632,"date":"2018-03-19T10:56:08","date_gmt":"2018-03-19T01:56:08","guid":{"rendered":"http:\/\/haisins.epac.to\/wordpress\/?p=3632"},"modified":"2018-03-19T10:56:08","modified_gmt":"2018-03-19T01:56:08","slug":"oracle-10g-r2-%eb%b6%80%ed%84%b0-group-by-%ec%a0%88%ec%97%90-%ec%9d%98%ed%95%9c-%ec%9e%90%eb%8f%99-%ec%a0%95%eb%a0%ac-%ec%9d%b4-%eb%90%98%ec%a7%80-%ec%95%8a%eb%8a%94-%ec%9d%b4%ec%9c%a0","status":"publish","type":"post","link":"http:\/\/haisins.synology.me\/wordpress\/?p=3632","title":{"rendered":"Oracle 10g R2 \ubd80\ud130 Group by \uc808\uc5d0 \uc758\ud55c \uc790\ub3d9 \uc815\ub82c \uc774 \ub418\uc9c0 \uc54a\ub294 \uc774\uc720"},"content":{"rendered":"<div>\n<table style=\"border-collapse: collapse;\" border=\"0\">\n<colgroup>\n<col style=\"width: 1417px;\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr>\n<td style=\"padding-left: 7px; padding-right: 7px; border: solid 0.5pt;\"><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">Oracle 10g R2\ubd80\ud130 Group By\uc808\uc5d0 \uc758\ud55c\u00a0Grouping Column\uc21c\uc73c\ub85c Sorting\ub418\uc9c0 \uc54a\ub294 \ubb38\uc81c\uc5d0 \ub300\ud55c \uc811\uadfc \ubc29\uc2dd\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\"><br \/>\n\uae30\uc874\uc758 \uace0\uac1d\uc774 Order by\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0 Group By\ub9cc\uc744 \uc0ac\uc6a9\ud558\uc600\ub2e4\uba74\u00a0\ubb38\uc81c\ub97c\u00a0\uc81c\uae30\ud560 \uc218 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">\uc774\ub7ec\ud55c \ubb38\uc81c\uc5d0 \ub300\ud55c \ub300\ucc98\ubc29\uc2dd\uc785\ub2c8\ub2e4.<br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\"><span style=\"background-color: yellow;\"><strong>Oracle 10g R2\uc758 &#8220;New in-Memory Sort Algorithm&#8221;\uc5d0 \ub530\ub978 \ubb38\uc81c\uc810 \ubc0f \uac1c\uc120\uc810<\/strong><\/span><br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">======================================================================<br \/>\n&gt;&gt;&gt;&gt; <span style=\"background-color: yellow;\"><strong>Oracle 10g R2 New Feature &#8211; New in-Memory Sort Algorithm \uc774\ub780?<\/strong><\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">1. \uc0c8\ub85c\uc6b4 sort \uc801\uc6a9 \ubc29\uc2dd<br \/>\n&#8211; \uae30\uc874\uc5d0\ub294 Sort \uc54c\uace0\ub9ac\uc998\uc73c\ub85c Sort\ud558\uc600\uc73c\ub098 &#8220;<span style=\"color: blue;\"><strong>Hash-based \ubc29\uc2dd<\/strong><\/span>&#8220;\uc758 New Feature<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">2. \uc131\ub2a5 \uac1c\uc120 \ud6a8\uacfc<br \/>\n&#8211; \ucda9\ubd84\ud55c Memory\uc77c \uacbd\uc6b0 (\uc989 In-Memory Sort)\uc77c \uacbd\uc6b0 \ud6a8\uacfc\uc801<br \/>\n&#8211; Sort operation\uc774 \uae30\uc874 \ubc29\uc2dd\uc5d0 \ube44\ud574 \ucd5c\ub300 5~10%\uae4c\uc9c0 \ube60\ub97c \uc218 \uc788\ub2e4.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">3. SORT\ud2b9\uc9d5\uc5d0 \ub530\ub978 \uac1c\uc120 \ud6a8\uacfc<br \/>\n&#8211; \ub192\uc740 cardinality (Row\ub4e4\uc758 Distinct\uac00 \ub9ce\uc740 \uacbd\uc6b0)\uc77c \uacbd\uc6b0 \ud2b9\ud788 \ud6a8\uacfc\uc801 (HASH\ubc29\uc2dd \uc774\ubbc0\ub85c)<br \/>\n&#8211; Faster CPU\uc77c \uacbd\uc6b0 \ub354\uc6b1 \ud6a8\uacfc\uc801<br \/>\n&#8211; \uc801\uc740 Column\uc744 Select \ud588\uc744 \uacbd\uc6b0 \ud2b9\ud788 \ud6a8\uacfc\uc801 (Hash\ub294 Memory\ubd80\uc871\uc5d0 \uc758\ud574 Disk\ub85c \ub0b4\ub824\uac00\uba74 \uaf5d)<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">======================================================================<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">&gt;&gt;&gt;&gt; <span style=\"background-color: yellow;\"><strong>New in-Memory Sort Algorithm \uc758 \ubb38\uc81c\uc810?<\/strong><\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n&#8220;GROUP BY&#8221;\ub97c \uc0ac\uc6a9\ud55c App\uac00 &#8220;ORDER BY&#8221;\ub97c \uae30\uc220\ud558\uc9c0 \uc54a\ub354\ub77c\ub3c4 Ordering\ub41c \uacb0\uacfc\ub97c Display\ud558\ub358<br \/>\nApp\ub4e4\uc774 10g R2\ub85c \uc624\uba74\uc11c \uc774 \uae30\ub2a5\uc774 \uae68\uc9c0\uac8c \ub418\uc5c8\uc74c.<br \/>\n\uc989 \ubc18\ub4dc\uc2dc Ordering\uc774 \ud544\uc694\ud558\uba74 &#8220;GROUP BY&#8221;\uc640 \ud568\uaed8 &#8220;ORDER BY&#8221;\ub97c \uae30\uc220\ud574\uc57c \ud568.<br \/>\n(\ucc38\uace0. \uc774\ub294 Oracle\uc758 Bug\uc740 \uc544\ub2c8\uba70 App\uc758 \uc798\ubabb\uc784)<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">======================================================================<br \/>\n<\/span><\/p>\n<p><span style=\"font-size: 9pt;\"><span style=\"font-family: \uad74\ub9bc;\">&gt;&gt;&gt;&gt; <span style=\"background-color: yellow;\"><strong>New in-Memory Sort Algorithm \uc758 \ubb38\uc81c\uc810\uc778 &#8220;GROUP BY&#8221;\ub97c \uae30\uc874 \ubc29\uc2dd\uc73c\ub85c \uc0ac\uc6a9\ud558\uae30 \uc704\ud574\uc11c\ub294?<\/strong><\/span><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n1. <span style=\"color: blue;\"><strong>Optimizer Mode\uac00 RULE<\/strong><\/span>\uc77c \uacbd\uc6b0\ub294 \ubc1c\uc0dd \uc548\ud568.<br \/>\n2. <span style=\"color: blue;\"><strong>OPTIMIZER_FEATURES_ENABLE\ub97c 10.1<\/strong><\/span>\u00a0\u00a0\ub85c \ud568<br \/>\n3. init.ora <span style=\"background-color: yellow;\"><strong>&#8220;_gby_hash_aggregation_enabled&#8221;=FALSE<\/strong><\/span>\u00a0\u00a0(New\ubc29\uc2dd \uc0ac\uc6a9 \uc548\ud568)<br \/>\n\uc704\uc758 \ubc29\uc2dd \uc911 3\ubc88\uc774 \ud574\ub2f9 \uae30\ub2a5 \ub9cc \ub9c9\uc73c\ubbc0\ub85c \uac00\uc7a5 \ub9ce\uc774 \uc0ac\uc6a9\ub420 \uac83\uc784.<br \/>\n\uadf8\ub7ec\ub098 New in-Memory Sort Algorithm\uc740 \uc544\uc8fc \uc720\uc6a9\ud55c \ubc29\uc2dd\uc774\ubbc0\ub85c App\ub97c \uc218\uc815\ud560 \uac83\uc744 \uace0\uac1d\ub4e4\uc5d0 \uad8c\uc7a5\ud560 \ud544\uc694\uac00 \uc788\uc74c.<br \/>\n<strong>\uad00\ub828 Doc <\/strong><\/span><span style=\"font-family: Wingdings;\"><strong>\u00e8<\/strong><\/span><span style=\"font-family: \uad74\ub9bc;\"><strong> Note:295819.1<\/strong> , <strong>Bug : 4604970<\/strong><br \/>\n<\/span><\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">Subject:\u00a0\u00a0Upgrading from 9i to 10g &#8211; Potential Query Tuning Related Issues<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\"><strong>## \uc2e4\ubb34\uc0ac\ub840 ##<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"color: blue; font-family: \uad74\ub9bc; font-size: 9pt;\"><br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true \">select r,\r\n  s1,\r\n  s2,\r\n  s3,\r\n  s4,\r\n  s5,\r\n  s6\r\nfrom (\r\n    select '' r,\r\n      '' s1,\r\n      '\ucd1d\uacc4' s2,\r\n      c3 s3,\r\n      decode(c4, null, '-', 0, '-', round((c3 - c4)*100\/c4, 1)) s4,\r\n      c1 s5,\r\n      decode(c2, null, '-', 0, '-', round((c1 - c2)*100\/c2, 1)) s6\r\n    from (\r\n        select sum(decode(yymm, '2006' ||'04', amts)) c1,\r\n          sum(decode(yymm, '2006'-1||'04', amts)) c2,\r\n          sum(decode(yymm, '2006'-1||'12', amts)) c3,\r\n          sum(decode(yymm, '2006'-2||'12', amts)) c4\r\n        from (\r\n            select \/*+ index (o kts_m2_x1) *\/yymm,\r\n              sum(decode('2', 1, trade_amt, trade_amt_acm)) amts\r\n            from kts_m2 o\r\n            where yymm in ('2006'||'04',\r\n                  '2006'-1||'04',\r\n                  '2006'-1||'12',\r\n                  '2006'-2||'12')\r\n              and ie_gbn = 'E'\r\n            group by yymm ) ) \r\n    union all\r\n    select to_char(rownum),\r\n      ctr_cd s1,\r\n      kor_name s2,\r\n      decode(amt4, null, 0, 0, 0, amt4) s3,\r\n      amt3 s4,\r\n      decode(amt2, null, 0, 0, 0, amt2) s5,\r\n      amt1 s6\r\n    from (\r\n        select max(a.ctr_cd) ctr_cd,\r\n          max(b.kor_name) kor_name,\r\n          max(a.s2) amt4,\r\n          max(decode(a.s2, null, '-', decode(a.s1, null, '-', 0, '-', round(100*(a.s2-a.s1)\/a.s1, 1)))) amt3,\r\n          -(-a.s4) amt2,\r\n          max(decode(a.s4, null, '-', decode(a.s3, null, '-', 0, '-', round(100*(a.s4-a.s3)\/a.s3, 1)))) amt1\r\n        from ctr_code b,\r\n          (\r\n            select \/*+ index ( kts_ctr kts_ctr_x1 ) *\/ctr_cd ctr_cd,\r\n              sum(decode(yymm, '2006'-2||'12', decode('2', '1', exp_amt, exp_amt_acm))) s1,\r\n              sum(decode(yymm, '2006'-1||'12', decode('2', '1', exp_amt, exp_amt_acm))) s2,\r\n              sum(decode(yymm, '2006'-1||'04', decode('2', '1', exp_amt, exp_amt_acm))) s3,\r\n              sum(decode(yymm, '2006' ||'04', decode('2', '1', exp_amt, exp_amt_acm))) s4\r\n            from kts_ctr\r\n            where yymm in ('2006'-2||'12',\r\n                  '2006'-1||'12',\r\n                  '2006'-1||'04',\r\n                  '2006'||'04')\r\n              and e_gbn = 'E'\r\n            group by ctr_cd ) a\r\n        where a.ctr_cd = b.ctr_cd\r\n        group by -a.s4, a.ctr_cd ) )\r\nwhere 1 = 1\r\nand rownum&lt;=11\r\n\r\n8i Plan\r\n0      SELECT STATEMENT Optimizer=CHOOSE (Cost=23 Card=11 Bytes=1K)\r\n   1    0   COUNT (STOPKEY)\r\n   2    1     VIEW (Cost=23 Card=11 Bytes=1K)\r\n   3    2       UNION-ALL\r\n   4    3         VIEW (Cost=8 Card=1 Bytes=52)\r\n   5    4           FILTER\r\n   6    5             SORT (AGGREGATE) (Card=1 Bytes=18)\r\n   7    6               VIEW (Cost=8 Card=3 Bytes=54)\r\n   8    7                 SORT (GROUP BY) (Card=3 Bytes=111)\r\n   9    8                   CONCATENATION\r\n  10    9                     INLIST ITERATOR\r\n  11   10                       TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_M2' (Cost=3 Card=1 Bytes=37)\r\n  12   11                         INDEX (RANGE SCAN) OF 'KSTAT.KTS_M2_X1' (UNIQUE) (Cost=2 Card=1)\r\n  13    9                     TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_M2' (Cost=3 Card=1 Bytes=37)\r\n  14   13                       INDEX (RANGE SCAN) OF 'KSTAT.KTS_M2_X1' (UNIQUE) (Cost=2 Card=1)\r\n  15    3         COUNT\r\n  16   15           VIEW (Cost=15 Card=10 Bytes=1000)\r\n  17   16             SORT (GROUP BY) (Cost=15 Card=10 Bytes=860)\r\n  18   17               HASH JOIN (Cost=13 Card=10 Bytes=860)\r\n  19   18                 VIEW (Cost=11 Card=6 Bytes=330)\r\n  20   19                   SORT (GROUP BY) (Card=6 Bytes=246)\r\n  21   20                     CONCATENATION\r\n  22   21                       TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_CTR' (Cost=3 Card=1 Bytes=41)\r\n  23   22                         INDEX (RANGE SCAN) OF 'KSTAT.KTS_CTR_X1' (UNIQUE) (Cost=2 Card=1)\r\n  24   21                       INLIST ITERATOR\r\n  25   24                         TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_CTR' (Cost=3 Card=1 Bytes=41)\r\n  26   25                           INDEX (RANGE SCAN) OF 'KSTAT.KTS_CTR_X1' (UNIQUE) (Cost=2 Card=1)\r\n  27   18                 TABLE ACCESS (FULL) OF 'KSTAT.CTR_CODE' (Cost=1 Card=164 Bytes=5K)\r\n\r\n\t\t\ucd1d\uacc4\t284418742503\t12\t99534827771\t11\r\n1\tCN\t\uc911\uad6d\t61914983215\t24.4\t20827196905\t12.1\r\n2\tUS\t\ubbf8\uad6d\t41342584390\t-3.5\t13858758704\t.9\r\n3\tJP\t\uc77c\ubcf8\t24027437900\t10.7\t8299955234\t9\r\n4\tHK\t\ud64d\ucf69\t15531092215\t-14.3\t5875131009\t25.1\r\n5\tTW\t\ub300\ub9cc\t10862932443\t10.3\t3795723262\t9.8\r\n6\tDE\t\ub3c5\uc77c\t10303964211\t23.6\t3254077284\t-5.6\r\n7\tSG\t\uc2f1\uac00\ud3ec\ub974\t7406634297\t31\t2832927989\t38.9\r\n8\tIN\t\uc778\ub514\uc544(\uc778\ub3c4)\t4597836954\t26.6\t1787342741\t32.9\r\n9\tGB\t\uc601\uad6d\t5338843555\t-3.2\t1738720242\t7.3\r\n10\tAU\t\ud638\uc8fc\t3812063148\t12.8\t1714611147\t44.7\r\n\r\n\r\n10g Plan\r\n0      SELECT STATEMENT Optimizer=RULE (Cost=8 Card=3 Bytes=366)\r\n   1    0   COUNT (STOPKEY)\r\n   2    1     VIEW (Cost=8 Card=3 Bytes=366)\r\n   3    2       UNION-ALL\r\n   4    3         VIEW (Cost=3 Card=1 Bytes=52)\r\n   5    4           FILTER\r\n   6    5             SORT (AGGREGATE) (Card=1 Bytes=21)\r\n   7    6               VIEW (Cost=3 Card=2 Bytes=42)\r\n   8    7                 HASH (GROUP BY) (Card=2 Bytes=74)\r\n   9    8                   CONCATENATION\r\n  10    9                     TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_M2' (TABLE) (Cost=1 Card=1 Bytes=37)\r\n  11   10                       INDEX (RANGE SCAN) OF 'KSTAT.KTS_M2_X1' (INDEX (UNIQUE)) (Cost=1 Card=1)\r\n  12    9                     INLIST ITERATOR\r\n  13   12                       TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_M2' (TABLE) (Cost=1 Card=1 Bytes=37)\r\n  14   13                         INDEX (RANGE SCAN) OF 'KSTAT.KTS_M2_X1' (INDEX (UNIQUE)) (Cost=1 Card=1)\r\n  15    3         COUNT\r\n  16   15           VIEW (Cost=5 Card=2 Bytes=202)\r\n  17   16             HASH (GROUP BY) (Cost=5 Card=2 Bytes=174)\r\n  18   17               NESTED LOOPS (Cost=4 Card=2 Bytes=174)\r\n  19   18                 VIEW (Cost=3 Card=2 Bytes=112)\r\n  20   19                   HASH (GROUP BY) (Card=2 Bytes=82)\r\n  21   20                     CONCATENATION\r\n  22   21                       TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_CTR' (TABLE) (Cost=1 Card=1 Bytes=41)\r\n  23   22                         INDEX (RANGE SCAN) OF 'KSTAT.KTS_CTR_X1' (INDEX (UNIQUE)) (Cost=1 Card=8)\r\n  24   21                       INLIST ITERATOR\r\n  25   24                         TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.KTS_CTR' (TABLE) (Cost=1 Card=1 Bytes=41)\r\n  26   25                           INDEX (RANGE SCAN) OF 'KSTAT.KTS_CTR_X1' (INDEX (UNIQUE)) (Cost=1 Card=8)\r\n  27   18                 TABLE ACCESS (BY INDEX ROWID) OF 'KSTAT.CTR_CODE' (TABLE) (Cost=1 Card=1 Bytes=31)\r\n  28   27                   INDEX (UNIQUE SCAN) OF 'KSTAT.CTR_CODE_PK' (INDEX (UNIQUE)) (Cost=1 Card=1)\r\n  \r\n\r\n\t\t\ucd1d\uacc4\t284418742503\t12\t99534827771\t11\r\n1\tAD\t\uc548\ub3c4\ub77c\t832819\t-34.4\t314756\t101.1\r\n2\tAE\t\uc544\ub78d\uc5d0\ubbf8\ub9ac\ud2b8 \uc5f0\ud569\t2732731530\t5.6\t905643855\t-5.3\r\n3\tAF\t\uc544\ud504\uce74\ub2c8\uc2a4\ud0c4\t59631357\t-22.7\t19712121\t-3.7\r\n4\tAG\t\uc548\ud2f0\uac00 \ubc14\ubd80\ub2e4\t4588172\t70.4\t2389520\t86.9\r\n5\tAI\t\uc559\uadc8\ub77c\t135659\t-43.9\t205\t-99.6\r\n6\tAL\t\uc54c\ubc14\ub2c8\uc544\t6326901\t-20.3\t7142128\t117.6\r\n7\tAM\t\uc544\ub974\uba54\ub2c8\uc544\t3149597\t45\t1658169\t142.3\r\n8\tAN\t\ub124\ub35c\ub780\ub4dc \uc5f4\ub3c4\t10756525\t50.5\t4937642\t78.2\r\n9\tAO\t\uc559\uace8\ub77c\t1517394108\t-16.4\t203785473\t-86.1\r\n10\tAQ\t\uc548\ud0c0\ud2f0\uce74\t132169\t-\t0\t-\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\"><strong>## \ud574\uacb0\ucc45 ##<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt; background-color: yellow;\">Init.ora \uc758 _gby_hash_aggregation_enabled=FALSE \uc758 \uacbd\uc6b0 <strong>group by \uc808 \ub2e4\uc74c\uc5d0 Single Column \uc778 \uacbd\uc6b0\uc5d0\ub294<br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\"><span style=\"background-color: yellow;\"><strong>\uc815\uc0c1\uc801\uc778 \uacb0\uacfc\uac00 \ub098\uc624\uc9c0\ub9cc<\/strong> 2\uac1c \uc774\uc0c1\uc758 Column \uc774 \ub098\uc624\ub294 \uacbd\uc6b0\uc5d0\ub294 \uacb0\uacfc\uac00 \ub2ec\ub77c\uc9c4\ub2e4.<\/span> \uc989 \uc704 Union all \uc758<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">From \uc808 In-Line View \uc758 group by \u2013a.s4 \uc758 \ud558\ub098\uc758 Column \uc73c\ub85c \uacb0\uacfc\ub97c \uad6c\ud558\uba74 \uc815\uc0c1\uc801\uc73c\ub85c Sorting \uc774<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt;\">\ub418\uc5b4\uc838\uc11c \uacb0\uacfc\uac00 \ub098\uc624\uc9c0\ub9cc, \uc608\ucc98\ub7fc \u2013a.s4, a.ctr_cd \ucc98\ub7fc Column \uc744 \ud558\ub098 \ub354 \ucd94\uac00\ud558\uba74 \uacb0\uacfc\uac00 \ub2ec\ub77c\uc9c4\ub2e4.<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \uad74\ub9bc; font-size: 9pt; background-color: yellow;\">\uc544\ub798\uc640 \uac19\uc774 group by \uc808 \ub2e4\uc74c\uc5d0 order by \uc808\uc744 \ucd94\uac00\ud558\uc5ec \uc900\ub2e4.<br \/>\n<\/span><\/p>\n<p><span style=\"color: blue; font-family: \uad74\ub9bc; font-size: 9pt;\"><br \/>\n<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true \">where a.ctr_cd = b.ctr_cd\r\n        group by -a.s4, a.ctr_cd\r\norder by \u2013a.s4,a.ctr_cd ) )\r\n\r\n\t\t\ucd1d\uacc4\t284418742503\t12\t99534827771\t11\r\n1\tCN\t\uc911\uad6d\t61914983215\t24.4\t20827196905\t12.1\r\n2\tUS\t\ubbf8\uad6d\t41342584390\t-3.5\t13858758704\t.9\r\n3\tJP\t\uc77c\ubcf8\t24027437900\t10.7\t8299955234\t9\r\n4\tHK\t\ud64d\ucf69\t15531092215\t-14.3\t5875131009\t25.1\r\n5\tTW\t\ub300\ub9cc\t10862932443\t10.3\t3795723262\t9.8\r\n6\tDE\t\ub3c5\uc77c\t10303964211\t23.6\t3254077284\t-5.6\r\n7\tSG\t\uc2f1\uac00\ud3ec\ub974\t7406634297\t31\t2832927989\t38.9\r\n8\tIN\t\uc778\ub514\uc544(\uc778\ub3c4)\t4597836954\t26.6\t1787342741\t32.9\r\n9\tGB\t\uc601\uad6d\t5338843555\t-3.2\t1738720242\t7.3\r\n10\tAU\t\ud638\uc8fc\t3812063148\t12.8\t1714611147\t44.7\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Oracle 10g R2\ubd80\ud130 Group By\uc808\uc5d0 \uc758\ud55c\u00a0Grouping Column\uc21c\uc73c\ub85c Sorting\ub418\uc9c0 \uc54a\ub294 \ubb38\uc81c\uc5d0 \ub300\ud55c \uc811\uadfc \ubc29\uc2dd\uc785\ub2c8\ub2e4. \uae30\uc874\uc758 \uace0\uac1d\uc774 Order by\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0 Group By\ub9cc\uc744 \uc0ac\uc6a9\ud558\uc600\ub2e4\uba74\u00a0\ubb38\uc81c\ub97c\u00a0\uc81c\uae30\ud560 \uc218 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ubb38\uc81c\uc5d0 \ub300\ud55c \ub300\ucc98\ubc29\uc2dd\uc785\ub2c8\ub2e4. &nbsp; Oracle 10g R2\uc758 &#8220;New in-Memory Sort Algorithm&#8221;\uc5d0 \ub530\ub978 \ubb38\uc81c\uc810 \ubc0f \uac1c\uc120\uc810 ====================================================================== &gt;&gt;&gt;&gt; Oracle 10g R2 New Feature &#8211; New in-Memory Sort Algorithm \uc774\ub780? &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2879,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":""},"categories":[14],"tags":[1047,788,1046],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/haisins.synology.me\/wordpress\/wp-content\/uploads\/2018\/02\/tip2.jpg?fit=400%2C400","amp_enabled":true,"_links":{"self":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3632"}],"collection":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3632"}],"version-history":[{"count":2,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3632\/revisions"}],"predecessor-version":[{"id":3635,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3632\/revisions\/3635"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/2879"}],"wp:attachment":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3632"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}