{"id":394,"date":"2010-11-28T09:47:36","date_gmt":"2010-11-28T07:47:36","guid":{"rendered":"http:\/\/zoharelkayam.wordpress.com\/?p=394"},"modified":"2010-11-28T09:47:36","modified_gmt":"2010-11-28T07:47:36","slug":"pivot-a-table","status":"publish","type":"post","link":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/","title":{"rendered":"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8"},"content":{"rendered":"<p>\u05d1\u05e2\u05d9\u05d4 \u05e0\u05e4\u05d5\u05e6\u05d4 \u05e9\u05dc\u05d0 \u05d4\u05d9\u05d4 \u05dc\u05d4 \u05e4\u05ea\u05e8\u05d5\u05df \u05e4\u05e9\u05d5\u05d8 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e4\u05e7\u05d5\u05d3\u05d4 \u05e2\u05d3 \u05d2\u05e8\u05e1\u05d4 11 \u05d4\u05d9\u05d0 \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8. \u05d1\u05d2\u05e8\u05e1\u05d4 11 \u05d9\u05e9\u05e0\u05d5 \u05e4\u05ea\u05e8\u05d5\u05df \u05d9\u05e2\u05d9\u05dc \u05d5\u05de\u05d4\u05d9\u05e8 \u05dc\u05d1\u05e2\u05d9\u05d4 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e6\u05de\u05d3 \u05e4\u05e7\u05d5\u05d3\u05d5\u05ea: Pivot \u05d5-Unpivot \u05e9\u05dc\u05d0 \u05de\u05e6\u05e8\u05d9\u05da \u05e0\u05d9\u05e4\u05e0\u05d5\u05e4\u05d9 \u05d9\u05d3\u05d9\u05d9\u05dd \u05d5\u05d4\u05e1\u05d1\u05e8\u05d9\u05dd \u05e2\u05dc \u05de\u05d9\u05de\u05d5\u05e9 \u05e9\u05dc\u05d9\u05e4\u05d4 \u05e9\u05ea\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d6\u05d4.<\/p>\n<p>\u05db\u05d3\u05d9 \u05e9\u05d4\u05e2\u05e0\u05d9\u05d9\u05df \u05d9\u05d4\u05d9\u05d4 \u05d1\u05e8\u05d5\u05e8, \u05d0\u05e0\u05d9 \u05d0\u05e6\u05d9\u05d2 \u05d3\u05d5\u05d2\u05de\u05d4 \u05e9\u05ea\u05e1\u05d1\u05d9\u05e8 \u05de\u05d4 \u05d6\u05d0\u05ea \u05d0\u05d5\u05de\u05e8\u05ea \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8 \u05d5\u05d0\u05e6\u05d9\u05d2 \u05e9\u05e0\u05d9 \u05e4\u05ea\u05e8\u05d5\u05e0\u05d5\u05ea \u05e9\u05d4\u05d9\u05d5 \u05d1\u05e9\u05d9\u05de\u05d5\u05e9 \u05dc\u05e4\u05e0\u05d9 \u05d2\u05e8\u05e1\u05d4 11. \u05d4\u05e4\u05ea\u05e8\u05d5\u05df \u05d4\u05e8\u05d0\u05e9\u05d5\u05df \u05d4\u05d5\u05d0 \u05d1\u05d0\u05de\u05e6\u05e2\u05d5\u05ea SQL \u05e4\u05e9\u05d5\u05d8 \u05e9\u05d9\u05db\u05d5\u05dc \u05d1\u05de\u05e7\u05e8\u05d9\u05dd \u05de\u05e1\u05d5\u05d9\u05d9\u05de\u05d9\u05dd \u05dc\u05d4\u05e4\u05d5\u05da \u05dc\u05de\u05e4\u05dc\u05e6\u05ea \u05e9\u05dc \u05d1\u05d9\u05e6\u05d5\u05e2\u05d9\u05dd \u05de\u05d1\u05d7\u05d9\u05e0\u05ea \u05e4\u05e2\u05d9\u05dc\u05d5\u05ea IO. \u05d4\u05e4\u05ea\u05e8\u05d5\u05df \u05d4\u05e9\u05e0\u05d9 \u05d4\u05d5\u05d0 \u05e4\u05ea\u05e8\u05d5\u05df \u05de\u05d5\u05e8\u05db\u05d1 \u05d9\u05d7\u05e1\u05d9\u05ea \u05e9\u05de\u05e9\u05ea\u05de\u05e9 \u05d1\u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d4 \u05d4\u05d0\u05e0\u05dc\u05d9\u05d8\u05d9\u05ea \u05d4\u05de\u05ea\u05d5\u05e1\u05d1\u05db\u05ea \u05d0\u05da \u05e9\u05d9\u05de\u05d5\u05e9\u05d9\u05ea model \u05e9\u05d7\u05d5\u05e1\u05da \u05d1\u05e4\u05e2\u05d5\u05dc\u05d5\u05ea IO \u05d0\u05d1\u05dc \u05d1\u05de\u05e7\u05e8\u05d9\u05dd \u05e9\u05dc \u05d8\u05d1\u05dc\u05d0\u05d5\u05ea \u05d2\u05d3\u05d5\u05dc\u05d5\u05ea \u05d4\u05d5\u05d0 \u05d4\u05d5\u05e4\u05da \u05dc\u05e6\u05e8\u05db\u05df \u05d6\u05db\u05e8\u05d5\u05df \u05de\u05e9\u05de\u05e2\u05d5\u05ea\u05d9. <\/p>\n<p>\u05db\u05de\u05d5\u05d1\u05df \u05e9\u05e1\u05d9\u05d1\u05d5\u05d1 \u05e2\u05dc \u05e6\u05d9\u05e8 \u05d4\u05d5\u05d0 \u05e1\u05d9\u05de\u05d8\u05e8\u05d9 \u05d5\u05e0\u05d9\u05ea\u05df \u05dc\u05d4\u05e4\u05d5\u05da \u05e9\u05d5\u05e8\u05d5\u05ea \u05dc\u05e2\u05de\u05d5\u05d3\u05d5\u05ea (\u05e9\u05d6\u05d4 \u05d9\u05d7\u05e1\u05d9\u05ea \u05e4\u05e9\u05d5\u05d8) \u05d5\u05e2\u05de\u05d5\u05d3\u05d5\u05ea \u05dc\u05e9\u05d5\u05e8\u05d5\u05ea (\u05e9\u05d6\u05d4 \u05db\u05d1\u05e8 \u05d9\u05d5\u05ea\u05e8 \u05de\u05e1\u05d5\u05d1\u05da). \u05d1\u05d5\u05d0 \u05e0\u05e8\u05d0\u05d4 \u05d0\u05d9\u05da \u05e4\u05d5\u05ea\u05e8\u05d9\u05dd \u05d0\u05ea \u05db\u05dc \u05d4\u05d1\u05dc\u05d0\u05d2\u05df \u05d4\u05d6\u05d4&#8230;<br \/>\n<!--more--><br \/>\n\u05dc\u05e6\u05d5\u05e8\u05da \u05d4\u05d3\u05d5\u05d2\u05de\u05d4, \u05e0\u05e0\u05d9\u05d7 \u05e9\u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d8\u05d1\u05dc\u05d4 \u05d4\u05e9\u05d5\u05de\u05e8\u05ea \u05dc\u05db\u05dc \u05e2\u05d5\u05d1\u05d3 \u05d0\u05ea \u05e0\u05ea\u05d5\u05e0\u05d9 \u05d4\u05de\u05db\u05d9\u05e8\u05d4 \u05e9\u05dc\u05d5 \u05dc\u05de\u05d5\u05e6\u05e8 \u05db\u05d0\u05e9\u05e8 \u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d1\u05d7\u05d1\u05e8\u05d4 \u05e9\u05dc\u05d5\u05e9\u05d4 \u05de\u05d5\u05e6\u05e8\u05d9\u05dd \u05e9\u05d5\u05e0\u05d9\u05dd.<br \/>\n\u05d4\u05d8\u05d1\u05dc\u05d4 \u05e9\u05dc\u05e0\u05d5 \u05ea\u05d9\u05e8\u05d0\u05d4 \u05db\u05db\u05d4:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\nEMP_NAME             PROD_NAME            AMOUNT\n-------------------- -------------------- ----------------------\nemp1                 prod1                11\nemp1                 prod2                22\nemp1                 prod3                33\nemp2                 prod1                111\nemp2                 prod2                222\nemp2                 prod3                333\nemp3                 prod1                1111\nemp3                 prod2                2222\nemp3                 prod3                3333\n<\/pre>\n<h4>PIVOT<\/h4>\n<p>\u05db\u05d3\u05d9 \u05dc\u05d4\u05e1\u05d1\u05d9\u05e8 \u05de\u05d4 \u05d6\u05d4 PIVOT, \u05e0\u05e0\u05d9\u05d7 \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d5\u05e6\u05d9\u05dd \u05dc\u05e8\u05d0\u05d5\u05ea \u05d0\u05ea \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05d1\u05e8\u05de\u05ea \u05d4\u05e2\u05d5\u05d1\u05d3 \u05db\u05dc\u05d5\u05de\u05e8 \u05dc\u05db\u05dc \u05e2\u05d5\u05d1\u05d3 \u05ea\u05d4\u05d9\u05d4 \u05e9\u05d5\u05e8\u05d4 \u05e0\u05e4\u05e8\u05d3\u05ea \u05d5\u05d1\u05d4 \u05d9\u05d4\u05d9\u05d5 \u05dc\u05d5 \u05e9\u05dc\u05d5\u05e9 \u05e2\u05de\u05d5\u05d3\u05d5\u05ea \u05e2\u05dd \u05e1\u05da \u05d4\u05de\u05db\u05d9\u05e8\u05d5\u05ea \u05e9\u05dc \u05db\u05dc \u05d0\u05d7\u05d3 \u05de\u05d4\u05de\u05d5\u05e6\u05e8\u05d9\u05dd. <\/p>\n<p>\u05db\u05d0\u05de\u05d5\u05e8, \u05e2\u05d3 \u05dc\u05d2\u05e8\u05e1\u05d4 11 \u05d4\u05d9\u05d5 \u05dc\u05e0\u05d5 \u05db\u05de\u05d4 \u05e4\u05ea\u05e8\u05d5\u05e0\u05d5\u05ea \u05e9\u05d4\u05e2\u05d9\u05e7\u05e8\u05d9 \u05e9\u05d1\u05d9\u05e0\u05d4\u05dd \u05d4\u05d9\u05d4 \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1-case \u05db\u05d3\u05d9 \u05dc\u05d4\u05d6\u05d9\u05d6 \u05d0\u05ea \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05de\u05e8\u05de\u05ea \u05e9\u05d5\u05e8\u05d4 \u05dc\u05e2\u05de\u05d5\u05d3\u05d4:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nselect emp_name,\nsum(case when prod_name =&#039;prod1&#039; then\n                        amount else null end) prod1,\nsum(case when prod_name =&#039;prod2&#039; then\n                        amount else null end) prod2,\nsum(case when prod_name =&#039;prod3&#039; then\n                        amount else null end) prod3\n from zelkayam2.test_model_pivot\ngroup by emp_name;\n<\/pre>\n<p>\u05e4\u05ea\u05e8\u05d5\u05df \u05d0\u05d7\u05e8 \u05d5\u05de\u05e1\u05d5\u05d1\u05da \u05dc\u05db\u05ea\u05d9\u05d1\u05d4 \u05d5\u05d4\u05d1\u05e0\u05d4 \u05d0\u05da \u05de\u05d4\u05d9\u05e8 \u05d9\u05d5\u05ea\u05e8 \u05d1\u05d1\u05d9\u05e6\u05d5\u05e2\u05d9\u05dd \u05d4\u05d9\u05d4 \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1\u05e4\u05e7\u05d5\u05d3\u05ea model:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nselect emp_name, prod1_sales_sum, prod2_sales_sum, prod3_sales_sum\nfrom zelkayam2.test_model_pivot\nmodel return updated rows\ndimension by (emp_name, prod_name)\nmeasures ( 0 prod1_sales_sum,\n           0 prod2_sales_sum,\n           0 prod3_sales_sum,\n           AMOUNT)\nrules upsert all\n          (\n            prod1_sales_sum&#x5B;any,&#039;na&#039;] = amount&#x5B;cv(),&#039;prod1&#039;],\n            prod2_sales_sum&#x5B;any,&#039;na&#039;] = amount&#x5B;cv(),&#039;prod2&#039;],\n            prod3_sales_sum&#x5B;any,&#039;na&#039;] = amount&#x5B;cv(),&#039;prod3&#039;]\n          );\n<\/pre>\n<p>\u05d4\u05d7\u05dc \u05de\u05d2\u05e8\u05e1\u05d4 11 \u05d0\u05e0\u05d5 \u05d9\u05db\u05d5\u05dc\u05d9\u05dd \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e4\u05e7\u05d5\u05d3\u05d4 \u05d4\u05d7\u05d3\u05e9\u05d4 PIVOT \u05db\u05d3\u05d9 \u05dc\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d0\u05d5\u05ea\u05d4 \u05e4\u05d5\u05e0\u05e7\u05e6\u05d9\u05d5\u05e0\u05dc\u05d9\u05d5\u05ea \u05d1\u05e6\u05d5\u05e8\u05d4 \u05e4\u05e9\u05d5\u05d8\u05d4 (\u05d5\u05e7\u05e6\u05e8\u05d4) \u05d1\u05d4\u05e8\u05d1\u05d4:<\/p>\n<pre class=\"brush: sql; highlight: [12]; title: ; notranslate\" title=\"\">\nSELECT *\n  FROM zelkayam2.test_model_pivot\n  PIVOT (SUM (amount)\n             FOR prod_name IN  (&#039;prod1&#039; AS prod1_sales_sum,\n                                            &#039;prod2&#039; AS prod2_sales_sum,\n                                            &#039;prod3&#039; AS prod3_sales_sum));\n\n----------------------------------------------------------------------------------------\n| Id  | Operation           | Name             | Rows  | Bytes | Cost (%CPU)| Time     |\n----------------------------------------------------------------------------------------\n|   0 | SELECT STATEMENT    |                  |     9 |   333 |     4  (25)| 00:00:01 |\n|   1 |  HASH GROUP BY PIVOT|                  |     9 |   333 |     4  (25)| 00:00:01 |\n|   2 |   TABLE ACCESS FULL | TEST_MODEL_PIVOT |     9 |   333 |     3   (0)| 00:00:01 |\n----------------------------------------------------------------------------------------\n\n<\/pre>\n<p>\u05e9\u05d5\u05e8\u05d4 3 \u05de\u05d2\u05d3\u05d9\u05e8\u05d4 \u05de\u05d4 \u05d9\u05d4\u05d9\u05d4 \u05d4\u05e2\u05e8\u05da \u05e9\u05d0\u05d5\u05ea\u05d5 \u05e0\u05e9\u05d9\u05dd \u05d1\u05e2\u05de\u05d5\u05d3\u05d5\u05ea.<br \/>\n\u05e9\u05d5\u05e8\u05d4 4 \u05de\u05d2\u05d3\u05d9\u05e8\u05d4 \u05dc\u05e4\u05d9 \u05d0\u05d9\u05d6\u05d4 \u05e2\u05de\u05d5\u05d3\u05d4 \u05e0\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d4\u05e4\u05d9\u05e8\u05d5\u05e7 \u05dc\u05e2\u05de\u05d5\u05d3\u05d5\u05ea.<br \/>\n\u05e9\u05d5\u05e8\u05d5\u05ea 4-6 \u05de\u05d2\u05d3\u05d9\u05e8\u05d5\u05ea \u05d0\u05ea \u05d4\u05e2\u05e8\u05db\u05d9\u05dd \u05e9\u05dc\u05e4\u05d9\u05d4\u05dd \u05e0\u05e9\u05d9\u05dd \u05d0\u05ea \u05d4\u05e2\u05e8\u05db\u05d9\u05dd \u05d1\u05e2\u05de\u05d5\u05d3\u05d5\u05ea \u05d4\u05d7\u05d3\u05e9\u05d5\u05ea.<\/p>\n<p>\u05db\u05de\u05d5\u05d1\u05df \u05e9\u05e9\u05dc\u05d5\u05e9\u05ea \u05d4\u05de\u05e7\u05e8\u05d9\u05dd \u05de\u05d7\u05d6\u05d9\u05e8\u05d9\u05dd \u05d0\u05ea \u05d0\u05d5\u05ea\u05d4 \u05d4\u05ea\u05d5\u05e6\u05d0\u05d4:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\nEMP_NAME             PROD1_SALES_SUM        PROD2_SALES_SUM        PROD3_SALES_SUM\n-------------------- ---------------------- ---------------------- ----------------------\nemp3                 1111                   2222                   3333\nemp1                 11                     22                     33\nemp2                 111                    222                    333\n<\/pre>\n<h4>UNPIVOT<\/h4>\n<p>\u05db\u05dc \u05d6\u05d4 \u05d8\u05d5\u05d1 \u05d5\u05d9\u05e4\u05d4 \u05d0\u05d1\u05dc \u05de\u05d4 \u05e7\u05d5\u05e8\u05d4 \u05db\u05e9\u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d0\u05ea \u05d4\u05d1\u05e2\u05d9\u05d4 \u05d4\u05d4\u05e4\u05d5\u05db\u05d4: \u05d9\u05e9 \u05dc\u05e0\u05d5 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dd \u05de\u05e1\u05e4\u05e8 \u05e2\u05d5\u05d1\u05d3\u05d9\u05dd \u05d5\u05e9\u05dc\u05d5\u05e9 \u05e2\u05de\u05d5\u05d3\u05d5\u05ea \u05e9\u05d0\u05d5\u05ea\u05df \u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d5\u05e6\u05d9\u05dd \u05dc\u05d4\u05e4\u05d5\u05da \u05dc\u05e9\u05d5\u05e8\u05d5\u05ea? \u05d1\u05de\u05e7\u05e8\u05d4 \u05db\u05d6\u05d4 \u05e0\u05e8\u05d0\u05d4 \u05e9\u05e0\u05e6\u05d8\u05e8\u05da \u05dc\u05d4\u05db\u05e4\u05d9\u05dc \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4 \u05db\u05de\u05e1\u05e4\u05e8 \u05d4\u05e2\u05de\u05d5\u05d3\u05d5\u05ea \u05db\u05d3\u05d9 \u05dc\u05e9\u05d8\u05d7 \u05d0\u05ea \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd.<\/p>\n<p>\u05d1\u05d2\u05e8\u05e1\u05d0\u05d5\u05ea \u05e7\u05d5\u05d3\u05de\u05d5\u05ea \u05d4\u05d9\u05d9\u05e0\u05d5 \u05e1\u05d5\u05e8\u05e7\u05d9\u05dd \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4 \u05e9\u05dc\u05d5\u05e9 \u05e4\u05e2\u05de\u05d9\u05dd:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nSELECT *\nFROM\n  ( \n  SELECT emp_name, &#039;prod1&#039; AS prod_name, prod1_sales_sum FROM zelkayam2.test_model_unpivot\n  UNION ALL\n  SELECT emp_name, &#039;prod2&#039; AS prod_name, prod2_sales_sum FROM zelkayam2.test_model_unpivot\n  UNION ALL\n  SELECT emp_name, &#039;prod3&#039; AS prod_name, prod3_sales_sum FROM zelkayam2.test_model_unpivot\n  );\n\n------------------------------------------------------------------------------------------\n| Id  | Operation           | Name               | Rows  | Bytes | Cost (%CPU)| Time     |\n------------------------------------------------------------------------------------------\n|   0 | SELECT STATEMENT    |                    |     9 |   288 |     9   (0)| 00:00:01 |\n|   1 |  VIEW               |                    |     9 |   288 |     9   (0)| 00:00:01 |\n|   2 |   UNION-ALL         |                    |       |       |            |          |\n|   3 |    TABLE ACCESS FULL| TEST_MODEL_UNPIVOT |     3 |    75 |     3   (0)| 00:00:01 |\n|   4 |    TABLE ACCESS FULL| TEST_MODEL_UNPIVOT |     3 |    75 |     3   (0)| 00:00:01 |\n|   5 |    TABLE ACCESS FULL| TEST_MODEL_UNPIVOT |     3 |    75 |     3   (0)| 00:00:01 |\n------------------------------------------------------------------------------------------\n<\/pre>\n<p>\u05d0\u05d5 \u05de\u05e9\u05ea\u05de\u05e9\u05d9\u05dd \u05d1\u05de\u05db\u05e4\u05dc\u05d4 \u05e7\u05e8\u05d8\u05d6\u05d9\u05ea \u05db\u05d3\u05d9 \u05dc\u05d7\u05e1\u05d5\u05da \u05e1\u05e8\u05d9\u05e7\u05d5\u05ea (\u05d0\u05d1\u05dc \u05dc\u05d0 \u05d6\u05db\u05e8\u05d5\u05df):<\/p>\n<pre class=\"brush: sql; title: ; wrap-lines: false; notranslate\" title=\"\">\nselect emp_name,\ncase \n  when b.lv = 1 then &#039;prod1&#039;\n  when b.lv = 2 then &#039;prod2&#039;\n  when b.lv = 3 then &#039;prod3&#039; end prod_name,\ncase \n  when b.lv = 1 then a.prod1_sales_sum \n  when b.lv = 2 then a.prod2_sales_sum \n  when b.lv = 3 then a.prod3_sales_sum end prod_sales_sum\nfrom zelkayam2.test_model_unpivot a, (select level lv from dual connect by level &amp;lt;= 3) b;\n\n-----------------------------------------------------------------------------------------------------\n| Id  | Operation                      | Name               | Rows  | Bytes | Cost (%CPU)| Time     |\n-----------------------------------------------------------------------------------------------------\n|   0 | SELECT STATEMENT               |                    |     3 |   192 |     5   (0)| 00:00:01 |\n|   1 |  MERGE JOIN CARTESIAN          |                    |     3 |   192 |     5   (0)| 00:00:01 |\n|   2 |   VIEW                         |                    |     1 |    13 |     2   (0)| 00:00:01 |\n|*  3 |    CONNECT BY WITHOUT FILTERING|                    |       |       |            |          |\n|   4 |     FAST DUAL                  |                    |     1 |       |     2   (0)| 00:00:01 |\n|   5 |   BUFFER SORT                  |                    |     3 |   153 |     5   (0)| 00:00:01 |\n|   6 |    TABLE ACCESS FULL           | TEST_MODEL_UNPIVOT |     3 |   153 |     3   (0)| 00:00:01 |\n-----------------------------------------------------------------------------------------------------\n\nPredicate Information (identified by operation id):\n---------------------------------------------------\n   3 - filter(LEVEL&amp;lt;=3)\n\n\n<\/pre>\n<p>\u05d0\u05e4\u05e9\u05e8\u05d5\u05ea \u05d0\u05d7\u05e8\u05ea \u05d4\u05d9\u05d9\u05ea\u05d4 \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e4\u05e7\u05d5\u05d3\u05ea model \u05e9\u05ea\u05e1\u05e8\u05d5\u05e7 \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4 \u05e4\u05e2\u05dd \u05d0\u05d7\u05ea \u05d0\u05d1\u05dc \u05e2\u05dc\u05d5\u05dc\u05d4 \u05dc\u05e6\u05e8\u05d5\u05da \u05d4\u05e8\u05d1\u05d4 \u05de\u05d0\u05d5\u05d3 \u05d6\u05db\u05e8\u05d5\u05df \u05db\u05d3\u05d9 \u05dc\u05d1\u05e0\u05d5\u05ea \u05d0\u05ea \u05d4\u05ea\u05d5\u05e6\u05d0\u05d4:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\nselect emp_name ,prod_name, amount\nfrom zelkayam2.test_model_unpivot \nmodel \nreturn updated rows\ndimension by (emp_name, &#039;prod_name&#039; prod_name)\nmeasures (prod1_sales_sum, prod2_sales_sum, prod3_sales_sum, 0 amount)\nrules upsert all\n(\n    amount&#x5B;any,&#039;prod1&#039;] = prod1_sales_sum&#x5B;cv(),&#039;prod_name&#039;],\n    amount&#x5B;any,&#039;prod2&#039;] = prod2_sales_sum&#x5B;cv(),&#039;prod_name&#039;],\n    amount&#x5B;any,&#039;prod3&#039;] = prod3_sales_sum&#x5B;cv(),&#039;prod_name&#039;]\n);\n\n-----------------------------------------------------------------------------------------\n| Id  | Operation          | Name               | Rows  | Bytes | Cost (%CPU)| Time     |\n-----------------------------------------------------------------------------------------\n|   0 | SELECT STATEMENT   |                    |     3 |   153 |     3   (0)| 00:00:01 |\n|   1 |  SQL MODEL ORDERED |                    |     3 |   153 |            |          |\n|   2 |   TABLE ACCESS FULL| TEST_MODEL_UNPIVOT |     3 |   153 |     3   (0)| 00:00:01 |\n-----------------------------------------------------------------------------------------\n<\/pre>\n<p>\u05d4\u05d7\u05dc \u05de\u05d2\u05e8\u05e1\u05d4 11 \u05d0\u05e0\u05d7\u05e0\u05d5 \u05d9\u05db\u05d5\u05dc\u05d9\u05dd \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e4\u05e7\u05d5\u05d3\u05ea unpivot \u05d4\u05e4\u05e9\u05d5\u05d8\u05d4 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d4\u05d1\u05d0\u05d4:<\/p>\n<pre class=\"brush: sql; highlight: [13]; title: ; notranslate\" title=\"\">\nSELECT *\n  FROM zelkayam2.test_model_unpivot \n  UNPIVOT (amount \n                             FOR prod_name IN (prod1_sales_sum AS &#039;prod1&#039;,\n\t\t\t\t\t\t\t   prod2_sales_sum AS &#039;prod2&#039;,\n\t\t\t\t\t\t\t   prod3_sales_sum AS &#039;prod3&#039;));\n\n------------------------------------------------------------------------------------------\n| Id  | Operation           | Name               | Rows  | Bytes | Cost (%CPU)| Time     |\n------------------------------------------------------------------------------------------\n|   0 | SELECT STATEMENT    |                    |     9 |   288 |     9   (0)| 00:00:01 |\n|*  1 |  VIEW               |                    |     9 |   288 |     9   (0)| 00:00:01 |\n|   2 |   UNPIVOT           |                    |       |       |            |          |\n|   3 |    TABLE ACCESS FULL| TEST_MODEL_UNPIVOT |     3 |   153 |     3   (0)| 00:00:01 |\n------------------------------------------------------------------------------------------\n\nPredicate Information (identified by operation id):\n---------------------------------------------------\n   1 - filter(&amp;quot;unpivot_view_006&amp;quot;.&amp;quot;AMOUNT&amp;quot; IS NOT NULL)\n<\/pre>\n<p>\u05e9\u05d5\u05e8\u05d4 3 \u05de\u05d2\u05d3\u05d9\u05e8\u05d4 \u05d0\u05ea \u05d4\u05e2\u05de\u05d5\u05d3\u05d4 \u05d4\u05d7\u05d3\u05e9\u05d4 \u05e9\u05d1\u05d4 \u05d9\u05d4\u05d9\u05d5 \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd (amount).<br \/>\n\u05e9\u05d5\u05e8\u05d4 4 \u05de\u05d2\u05d3\u05d9\u05e8\u05d4 \u05d0\u05ea \u05d4\u05e2\u05de\u05d5\u05d3\u05d4 \u05d4\u05d7\u05d3\u05e9\u05d4 \u05e9\u05d1\u05d4 \u05d9\u05d4\u05d9\u05d5 \u05d4\u05e0\u05ea\u05d5\u05e0\u05d9\u05dd \u05d4\u05d7\u05d5\u05ea\u05db\u05d9\u05dd (prod_name).<br \/>\n\u05e9\u05d5\u05e8\u05d5\u05ea 4-6 \u05de\u05d2\u05d3\u05d9\u05e8\u05d5\u05ea \u05d0\u05ea \u05d4\u05e2\u05e8\u05db\u05d9\u05dd \u05e9\u05d9\u05d7\u05dc\u05d9\u05e4\u05d5 \u05db\u05dc \u05d0\u05d7\u05ea \u05de\u05d4\u05e2\u05de\u05d5\u05d3\u05d5\u05ea \u05e9\u05de\u05e1\u05ea\u05d5\u05d1\u05d1\u05d5\u05ea \u05e2\u05dc \u05d4\u05e6\u05d9\u05e8.<\/p>\n<p>\u05d1\u05e2\u05d6\u05e8\u05ea \u05e9\u05d9\u05de\u05d5\u05e9 \u05d1\u05e4\u05e7\u05d5\u05d3\u05d5\u05ea \u05d4\u05d0\u05dc\u05d4 \u05e7\u05dc \u05d4\u05e8\u05d1\u05d4 \u05d9\u05d5\u05ea\u05e8 \u05dc\u05e1\u05d5\u05d1\u05d1 \u05d8\u05d1\u05dc\u05d0\u05d5\u05ea \u05e2\u05dc \u05e6\u05d9\u05e8 &#8211; \u05d4\u05df \u05de\u05d1\u05d7\u05d9\u05e0\u05ea \u05d4\u05db\u05ea\u05d9\u05d1\u05d4 \u05d5\u05d4\u05df \u05de\u05d1\u05d7\u05d9\u05e0\u05ea \u05d4\u05d1\u05d9\u05e6\u05d5\u05e2\u05d9\u05dd.<br \/>\n\u05db\u05e8\u05d2\u05d9\u05dc, \u05d0\u05dd \u05d9\u05e9 \u05e9\u05d0\u05dc\u05d5\u05ea \u05d0\u05d5 \u05d4\u05e2\u05e8\u05d5\u05ea &#8211; \u05d0\u05e0\u05d9 \u05d0\u05e9\u05de\u05d7 \u05dc\u05e9\u05de\u05d5\u05e2&#8230; \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u05d1\u05e2\u05d9\u05d4 \u05e0\u05e4\u05d5\u05e6\u05d4 \u05e9\u05dc\u05d0 \u05d4\u05d9\u05d4 \u05dc\u05d4 \u05e4\u05ea\u05e8\u05d5\u05df \u05e4\u05e9\u05d5\u05d8 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e4\u05e7\u05d5\u05d3\u05d4 \u05e2\u05d3 \u05d2\u05e8\u05e1\u05d4 11 \u05d4\u05d9\u05d0 \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8. \u05d1\u05d2\u05e8\u05e1\u05d4 11 \u05d9\u05e9\u05e0\u05d5 \u05e4\u05ea\u05e8\u05d5\u05df \u05d9\u05e2\u05d9\u05dc \u05d5\u05de\u05d4\u05d9\u05e8 \u05dc\u05d1\u05e2\u05d9\u05d4 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e6\u05de\u05d3 \u05e4\u05e7\u05d5\u05d3\u05d5\u05ea: Pivot \u05d5-Unpivot \u05e9\u05dc\u05d0 \u05de\u05e6\u05e8\u05d9\u05da \u05e0\u05d9\u05e4\u05e0\u05d5\u05e4\u05d9 \u05d9\u05d3\u05d9\u05d9\u05dd \u05d5\u05d4\u05e1\u05d1\u05e8\u05d9\u05dd \u05e2\u05dc \u05de\u05d9\u05de\u05d5\u05e9 \u05e9\u05dc\u05d9\u05e4\u05d4 \u05e9\u05ea\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d6\u05d4. \u05db\u05d3\u05d9 \u05e9\u05d4\u05e2\u05e0\u05d9\u05d9\u05df \u05d9\u05d4\u05d9\u05d4 \u05d1\u05e8\u05d5\u05e8, \u05d0\u05e0\u05d9 \u05d0\u05e6\u05d9\u05d2 \u05d3\u05d5\u05d2\u05de\u05d4 \u05e9\u05ea\u05e1\u05d1\u05d9\u05e8 \u05de\u05d4 \u05d6\u05d0\u05ea \u05d0\u05d5\u05de\u05e8\u05ea \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,12,14],"tags":[85,86,106,126],"class_list":["post-394","post","type-post","status-publish","format-standard","hentry","category-oracle","category-12","category-14","tag-oracle-2","tag-oracle-11g","tag-pivot","tag-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8 - Real Time DBA Magic<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/\" \/>\n<meta property=\"og:locale\" content=\"he_IL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8 - Real Time DBA Magic\" \/>\n<meta property=\"og:description\" content=\"\u05d1\u05e2\u05d9\u05d4 \u05e0\u05e4\u05d5\u05e6\u05d4 \u05e9\u05dc\u05d0 \u05d4\u05d9\u05d4 \u05dc\u05d4 \u05e4\u05ea\u05e8\u05d5\u05df \u05e4\u05e9\u05d5\u05d8 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e4\u05e7\u05d5\u05d3\u05d4 \u05e2\u05d3 \u05d2\u05e8\u05e1\u05d4 11 \u05d4\u05d9\u05d0 \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8. \u05d1\u05d2\u05e8\u05e1\u05d4 11 \u05d9\u05e9\u05e0\u05d5 \u05e4\u05ea\u05e8\u05d5\u05df \u05d9\u05e2\u05d9\u05dc \u05d5\u05de\u05d4\u05d9\u05e8 \u05dc\u05d1\u05e2\u05d9\u05d4 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e6\u05de\u05d3 \u05e4\u05e7\u05d5\u05d3\u05d5\u05ea: Pivot \u05d5-Unpivot \u05e9\u05dc\u05d0 \u05de\u05e6\u05e8\u05d9\u05da \u05e0\u05d9\u05e4\u05e0\u05d5\u05e4\u05d9 \u05d9\u05d3\u05d9\u05d9\u05dd \u05d5\u05d4\u05e1\u05d1\u05e8\u05d9\u05dd \u05e2\u05dc \u05de\u05d9\u05de\u05d5\u05e9 \u05e9\u05dc\u05d9\u05e4\u05d4 \u05e9\u05ea\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d6\u05d4. \u05db\u05d3\u05d9 \u05e9\u05d4\u05e2\u05e0\u05d9\u05d9\u05df \u05d9\u05d4\u05d9\u05d4 \u05d1\u05e8\u05d5\u05e8, \u05d0\u05e0\u05d9 \u05d0\u05e6\u05d9\u05d2 \u05d3\u05d5\u05d2\u05de\u05d4 \u05e9\u05ea\u05e1\u05d1\u05d9\u05e8 \u05de\u05d4 \u05d6\u05d0\u05ea \u05d0\u05d5\u05de\u05e8\u05ea \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/\" \/>\n<meta property=\"og:site_name\" content=\"Real Time DBA Magic\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/zohare\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/zohare\" \/>\n<meta property=\"article:published_time\" content=\"2010-11-28T07:47:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.realdbamagic.com\/wp-content\/uploads\/2014\/12\/Facebook-Share-profile-photo-270-x-270_2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"270\" \/>\n\t<meta property=\"og:image:height\" content=\"270\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@realmgic\" \/>\n<meta name=\"twitter:site\" content=\"@realmgic\" \/>\n<meta name=\"twitter:label1\" content=\"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u05d3\u05e7\u05d5\u05ea\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/\"},\"author\":{\"name\":\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/fef9c8983df7a5ec53d0e2c733148334\"},\"headline\":\"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8\",\"datePublished\":\"2010-11-28T07:47:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/\"},\"wordCount\":615,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/13e6cf68689bd7ea5f6556f5246e6175\"},\"keywords\":[\"oracle\",\"Oracle 11g\",\"pivot\",\"SQL\"],\"articleSection\":{\"0\":\"Oracle\",\"2\":\"\u05e9\u05dc\u05d9\u05e4\u05d5\u05ea\"},\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/\",\"url\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/\",\"name\":\"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8 - Real Time DBA Magic\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#website\"},\"datePublished\":\"2010-11-28T07:47:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/#breadcrumb\"},\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/pivot-a-table\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#website\",\"url\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/\",\"name\":\"Real Time DBA Magic\",\"description\":\"Doing Real Time DBA Magics\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/13e6cf68689bd7ea5f6556f5246e6175\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"he-IL\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/13e6cf68689bd7ea5f6556f5246e6175\",\"name\":\"Zohar Elkayam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\",\"caption\":\"Zohar Elkayam\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\"},\"sameAs\":[\"https:\\\/\\\/zoharelkayam.me\",\"https:\\\/\\\/facebook.com\\\/zohare\",\"https:\\\/\\\/x.com\\\/realmgic\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/fef9c8983df7a5ec53d0e2c733148334\",\"name\":\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g\",\"caption\":\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\"},\"sameAs\":[\"https:\\\/\\\/zoharelkayam.me\",\"https:\\\/\\\/facebook.com\\\/zohare\",\"https:\\\/\\\/x.com\\\/realmgic\"],\"url\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/author\\\/zohar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8 - Real Time DBA Magic","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/","og_locale":"he_IL","og_type":"article","og_title":"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8 - Real Time DBA Magic","og_description":"\u05d1\u05e2\u05d9\u05d4 \u05e0\u05e4\u05d5\u05e6\u05d4 \u05e9\u05dc\u05d0 \u05d4\u05d9\u05d4 \u05dc\u05d4 \u05e4\u05ea\u05e8\u05d5\u05df \u05e4\u05e9\u05d5\u05d8 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e4\u05e7\u05d5\u05d3\u05d4 \u05e2\u05d3 \u05d2\u05e8\u05e1\u05d4 11 \u05d4\u05d9\u05d0 \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8. \u05d1\u05d2\u05e8\u05e1\u05d4 11 \u05d9\u05e9\u05e0\u05d5 \u05e4\u05ea\u05e8\u05d5\u05df \u05d9\u05e2\u05d9\u05dc \u05d5\u05de\u05d4\u05d9\u05e8 \u05dc\u05d1\u05e2\u05d9\u05d4 \u05e2\u05dc \u05d9\u05d3\u05d9 \u05e6\u05de\u05d3 \u05e4\u05e7\u05d5\u05d3\u05d5\u05ea: Pivot \u05d5-Unpivot \u05e9\u05dc\u05d0 \u05de\u05e6\u05e8\u05d9\u05da \u05e0\u05d9\u05e4\u05e0\u05d5\u05e4\u05d9 \u05d9\u05d3\u05d9\u05d9\u05dd \u05d5\u05d4\u05e1\u05d1\u05e8\u05d9\u05dd \u05e2\u05dc \u05de\u05d9\u05de\u05d5\u05e9 \u05e9\u05dc\u05d9\u05e4\u05d4 \u05e9\u05ea\u05d1\u05e6\u05e2 \u05d0\u05ea \u05d6\u05d4. \u05db\u05d3\u05d9 \u05e9\u05d4\u05e2\u05e0\u05d9\u05d9\u05df \u05d9\u05d4\u05d9\u05d4 \u05d1\u05e8\u05d5\u05e8, \u05d0\u05e0\u05d9 \u05d0\u05e6\u05d9\u05d2 \u05d3\u05d5\u05d2\u05de\u05d4 \u05e9\u05ea\u05e1\u05d1\u05d9\u05e8 \u05de\u05d4 \u05d6\u05d0\u05ea \u05d0\u05d5\u05de\u05e8\u05ea \u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 [&hellip;]","og_url":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/","og_site_name":"Real Time DBA Magic","article_publisher":"https:\/\/facebook.com\/zohare","article_author":"https:\/\/facebook.com\/zohare","article_published_time":"2010-11-28T07:47:36+00:00","og_image":[{"width":270,"height":270,"url":"https:\/\/www.realdbamagic.com\/wp-content\/uploads\/2014\/12\/Facebook-Share-profile-photo-270-x-270_2.png","type":"image\/png"}],"author":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","twitter_card":"summary_large_image","twitter_creator":"@realmgic","twitter_site":"@realmgic","twitter_misc":{"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da":"3 \u05d3\u05e7\u05d5\u05ea"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/#article","isPartOf":{"@id":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/"},"author":{"name":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/fef9c8983df7a5ec53d0e2c733148334"},"headline":"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8","datePublished":"2010-11-28T07:47:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/"},"wordCount":615,"commentCount":1,"publisher":{"@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/13e6cf68689bd7ea5f6556f5246e6175"},"keywords":["oracle","Oracle 11g","pivot","SQL"],"articleSection":{"0":"Oracle","2":"\u05e9\u05dc\u05d9\u05e4\u05d5\u05ea"},"inLanguage":"he-IL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/","url":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/","name":"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8 - Real Time DBA Magic","isPartOf":{"@id":"https:\/\/www.realdbamagic.com\/he\/#website"},"datePublished":"2010-11-28T07:47:36+00:00","breadcrumb":{"@id":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/#breadcrumb"},"inLanguage":"he-IL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.realdbamagic.com\/he\/pivot-a-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.realdbamagic.com\/he\/"},{"@type":"ListItem","position":2,"name":"\u05e1\u05d9\u05d1\u05d5\u05d1 \u05d8\u05d1\u05dc\u05d4 \u05e2\u05dc \u05e6\u05d9\u05e8"}]},{"@type":"WebSite","@id":"https:\/\/www.realdbamagic.com\/he\/#website","url":"https:\/\/www.realdbamagic.com\/he\/","name":"Real Time DBA Magic","description":"Doing Real Time DBA Magics","publisher":{"@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/13e6cf68689bd7ea5f6556f5246e6175"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.realdbamagic.com\/he\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"he-IL"},{"@type":["Person","Organization"],"@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/13e6cf68689bd7ea5f6556f5246e6175","name":"Zohar Elkayam","image":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g","caption":"Zohar Elkayam"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g"},"sameAs":["https:\/\/zoharelkayam.me","https:\/\/facebook.com\/zohare","https:\/\/x.com\/realmgic"]},{"@type":"Person","@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/fef9c8983df7a5ec53d0e2c733148334","name":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","image":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/secure.gravatar.com\/avatar\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g","caption":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd"},"sameAs":["https:\/\/zoharelkayam.me","https:\/\/facebook.com\/zohare","https:\/\/x.com\/realmgic"],"url":"https:\/\/www.realdbamagic.com\/he\/author\/zohar\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5e40u-6m","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/posts\/394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/comments?post=394"}],"version-history":[{"count":0,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/posts\/394\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/media?parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/categories?post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/tags?post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}