{"id":75992,"date":"2024-05-04T22:50:43","date_gmt":"2024-05-05T02:50:43","guid":{"rendered":"http:\/\/bangla.sitestree.com\/oracle-advanced-sql-clauses-2\/"},"modified":"2024-05-04T22:50:43","modified_gmt":"2024-05-05T02:50:43","slug":"oracle-advanced-sql-clauses-2","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=75992","title":{"rendered":"Oracle Advanced SQL Clauses"},"content":{"rendered":"<p>Group By<\/p>\n<p>group by attr1, attr2<\/p>\n<p>group by ROLLUP(attr1, attr2)<\/p>\n<p>group by CUBE(attr1, attr2)<\/p>\n<p>Rank, Dense_RANK, ROW_number:<\/p>\n<p>RANK() OVER (ORDER BY PRICE) as &quot;PR&quot;,<br \/>\nROW_NUMBER() OVER (ORDER BY PRICE) as &quot;PR&quot;<br \/>\nDENSE_RANK() OVER (ORDER BY C DESC NULLS LAST) as &quot;R&quot;<br \/>\nDENSE_RANK() OVER (PARTITION by C ORDER BY P) as &quot;PR&quot;<br \/>\nRANK() OVER (ORDER BY P) as &quot;PR&quot;<br \/>\navg(C) OVER() AS &quot;AC&quot;<br \/>\nMIN(Y) KEEP (DENSE_RANK FIRST ORDER BY Y) as &quot;FirstItem&quot;<br \/>\nMIN(Y) KEEP (DENSE_RANK LAST ORDER BY Y) as &quot;LASTItem&quot;<\/p>\n<p>Hierarchical Query:<\/p>\n<p>START WITH employee_id = 102<br \/>\nCONNECT BY FOLLOWING m_id = e_id;<\/p>\n<p>Keep First or Last Row<\/p>\n<p>KEEP (DENSE_RANK FIRST ORDER BY \u2026)<br \/>\nKEEP (DENSE_RANK LAST ORDER BY \u2026)<\/p>\n<p>PARTITION BY on RANK\/Dense_Rank<\/p>\n<p>RANK()<br \/>\nRANK() OVER<br \/>\nRANK() OVER PARTITION BY<br \/>\nDENSE RANK() OVER<br \/>\nDENSE RANK() OVER PARTITION BY<br \/>\nPARTITION BY \u2026. ORDER BY<br \/>\nROW_NUMBER() OVER (ORDER By \u2026)<br \/>\nROWS BETWEEN Unbounded Preceding and CURRENT ROW<br \/>\nRANGE BETWEEN INTERVAL 5 DAY PRECEDING AND INTERVAL &#8216;5&#8217; DAY Following<br \/>\nROWS BETWENN 1 PRECEDING and 1 FOLLOWING<br \/>\nDENSE RANK() OVER (PARTITION BY &#8230;..)<br \/>\nDENSE RANK() OVER (PARTITION BY &#8230;..ORDER BY &#8230;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Group By group by attr1, attr2 group by ROLLUP(attr1, attr2) group by CUBE(attr1, attr2) Rank, Dense_RANK, ROW_number: RANK() OVER (ORDER BY PRICE) as &quot;PR&quot;, ROW_NUMBER() OVER (ORDER BY PRICE) as &quot;PR&quot; DENSE_RANK() OVER (ORDER BY C DESC NULLS LAST) as &quot;R&quot; DENSE_RANK() OVER (PARTITION by C ORDER BY P) as &quot;PR&quot; RANK() OVER (ORDER BY &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=75992\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[182],"tags":[],"class_list":["post-75992","post","type-post","status-publish","format-standard","hentry","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":76666,"url":"http:\/\/bangla.sitestree.com\/?p=76666","url_meta":{"origin":75992,"position":0},"title":"Oracle: Hierarchical Queries and Advanced Analytics Functions","author":"Sayed","date":"March 26, 2025","format":false,"excerpt":"\u2022Hierarchical Queries \u2022START WITH \u2022CONNECT BY PRIOR \u2022CONNECT BY FOLLOWING \u2022ORDER by level \u2022Analytics Functions \u2022Windowing \u2022PRECEDING, UNBOUNDED_PRECEDING \u2022ROWS BETWEEN Unbounded Preceding \u2022CURRENT ROW \u2022RANGE BETWEEN INTERVAL 30 DAY PRECEDING AND INTERVAL \u201830\u2019 DAY Following \u2022ROWS BETWENN 1 PRECEDING and 1 FOLLOWING Other Analytics Functions and Clauses: \u2022OVER() \u2022PARTITION OVER\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78165,"url":"http:\/\/bangla.sitestree.com\/?p=78165","url_meta":{"origin":75992,"position":1},"title":"Oracle PL\/SQL Concepts","author":"Sayed","date":"May 14, 2025","format":false,"excerpt":"Oracle PL\/SQL Concepts BLOCK declare .... Begin...End. Cursor Trigger Programming Clauses: if..then...else, case when, loops (for, while) Stored Procedure Function Advanced SQLs and Analytics Functions GROUP BY ROLLUP(), GROUP BY CUBE() RANK(), DENSE_RANK(), ROW_NUMBER() PARTITION_BY, ORDER BY X NULLS Last, ORDER BY X NULLS FIRST, RANGE BETWEEN INTERVAL 30 DAY\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":71316,"url":"http:\/\/bangla.sitestree.com\/?p=71316","url_meta":{"origin":75992,"position":2},"title":"What is the rank of a matrix?","author":"Sayed","date":"October 3, 2021","format":false,"excerpt":"If you can, answer the question below: Write your answer in the comment box. What is the rank of a matrix?","rel":"","context":"In &quot;Matrix and Signal Processing&quot;","block_context":{"text":"Matrix and Signal Processing","link":"http:\/\/bangla.sitestree.com\/?cat=1944"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17008,"url":"http:\/\/bangla.sitestree.com\/?p=17008","url_meta":{"origin":75992,"position":3},"title":"Python: Ecommerce: Part \u2014 7: Partition a Data File (with product information) into Multiple Files.","author":"Sayed","date":"April 19, 2020","format":false,"excerpt":"In previous steps, we created a product data file to be uploaded to Magento 2 (from supplier data). However, there is a limit, how big a file can be uploaded to Magento 2 for product data import. Hence, this code will divide the data file into multiple files. This data\u2026","rel":"","context":"In &quot;Build Ecommerce Software&quot;","block_context":{"text":"Build Ecommerce Software","link":"http:\/\/bangla.sitestree.com\/?cat=1912"},"img":{"alt_text":"8112223 Canada Inc. (Justetc)","src":"https:\/\/miro.medium.com\/fit\/c\/80\/80\/0*P_esmjKoJnHlNjFX","width":350,"height":200},"classes":[]},{"id":17010,"url":"http:\/\/bangla.sitestree.com\/?p=17010","url_meta":{"origin":75992,"position":4},"title":"Python: Ecommerce: Part \u2014 9: Incorporate Images in your Magento 2 product Upload File","author":"Sayed","date":"April 19, 2020","format":false,"excerpt":"\u00a0 8112223 Canada Inc. (Justetc) \u00a0 Apr 19\u00a0\u00b7\u00a03\u00a0min read \u00a0 \u00a0 In [112]: #magento_1_upload_file_with_image_urls_no_desc['magento_2_upload_file_with_data_no_desc['gallery_image_url_1'] = raw_df['Additional Product Picture 1']magento_2_upload_file_with_data_no_desc['gallery_image_url_2'] = raw_df['Additional Product Picture 2']magento_2_upload_file_with_data_no_desc['gallery_image_url_3'] = raw_df['Additional Product Picture 3']magento_2_upload_file_with_data_no_desc['gallery_image_url_4'] = raw_df['Additional Product Picture 4']magento_2_upload_file_with_data_no_desc['gallery_image_url_5'] = raw_df['Additional Product Picture 5']magento_2_upload_file_with_data_no_desc['gallery_image_url_6'] = raw_df['Additional Product Picture 6']magento_2_upload_file_with_data_no_desc['gallery_image_url_7'] = raw_df['Additional Product Picture 7']magento_2_upload_file_with_data_no_desc['gallery_image_url_8'] =\u2026","rel":"","context":"In &quot;Build Ecommerce Software&quot;","block_context":{"text":"Build Ecommerce Software","link":"http:\/\/bangla.sitestree.com\/?cat=1912"},"img":{"alt_text":"8112223 Canada Inc. (Justetc)","src":"https:\/\/miro.medium.com\/fit\/c\/80\/80\/0*P_esmjKoJnHlNjFX","width":350,"height":200},"classes":[]},{"id":14016,"url":"http:\/\/bangla.sitestree.com\/?p=14016","url_meta":{"origin":75992,"position":5},"title":"Linux: LVM : Logical Volume Manager : Multiple Hard Disk and Partition and Volume Management","author":"Sayed","date":"December 12, 2017","format":false,"excerpt":"On RedHat\/Centos Linux - LVM experiments Concepts to understand: Physical Volume: Physical Hard Drive or\u00a0 Partitions in Physical Hard Drive Physical Extent:\u00a0 One unit of space usually 4 MB. Volume Group: One or multiple Physical Volumes can be assigned to a Volume Group Logical Volume: Logical volumes are created from\u2026","rel":"","context":"In &quot;\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix&quot;","block_context":{"text":"\u09b2\u09bf\u09a8\u09be\u0995\u09cd\u09b8 \u098f\u09ac\u0982 \u0989\u09a8\u09bf\u0995\u09cd\u09b8 \u0964 Linux and Unix","link":"http:\/\/bangla.sitestree.com\/?cat=1231"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/75992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75992"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/75992\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75992"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}