{"id":76666,"date":"2025-03-26T01:41:28","date_gmt":"2025-03-26T01:41:28","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=76666"},"modified":"2025-03-26T01:41:29","modified_gmt":"2025-03-26T01:41:29","slug":"oracle-hierarchical-queries-and-advanced-analytics-functions","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=76666","title":{"rendered":"Oracle: Hierarchical Queries and Advanced Analytics Functions"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>\u2022Hierarchical Queries<\/p>\n\n\n\n<p>\u2022START WITH<\/p>\n\n\n\n<p>\u2022CONNECT BY PRIOR<\/p>\n\n\n\n<p>\u2022CONNECT BY FOLLOWING<\/p>\n\n\n\n<p>\u2022ORDER by level<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u2022<strong>Analytics Functions<\/strong><\/p>\n\n\n\n<p>\u2022Windowing<\/p>\n\n\n\n<p>\u2022PRECEDING, UNBOUNDED_PRECEDING<\/p>\n\n\n\n<p>\u2022ROWS BETWEEN Unbounded Preceding<\/p>\n\n\n\n<p>\u2022CURRENT ROW<\/p>\n\n\n\n<p>\u2022RANGE BETWEEN INTERVAL 30 DAY PRECEDING AND INTERVAL \u201830\u2019 DAY Following<\/p>\n\n\n\n<p>\u2022ROWS BETWENN 1 PRECEDING and 1 FOLLOWING<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Other Analytics Functions and Clauses:<\/strong><\/p>\n\n\n\n<p>\u2022OVER()<\/p>\n\n\n\n<p>\u2022PARTITION OVER<\/p>\n\n\n\n<p>\u2022Over Partition By<\/p>\n\n\n\n<p>\u2022Avg () OVER Partition BY<\/p>\n\n\n\n<p>\u2022RANK()<\/p>\n\n\n\n<p>\u2022DENSE_RANK()<\/p>\n\n\n\n<p>\u2022DENSE_RANK FIRST<\/p>\n\n\n\n<p>\u2022DENSE_RANK LAST<\/p>\n\n\n\n<p>\u2022RANK or DENSE_RANK OVER<\/p>\n\n\n\n<p>\u2022KEEP<\/p>\n\n\n\n<p>\u2022Aggregate by keeping<\/p>\n\n\n\n<p>\u2022\u2022KEEP (DENSE_RANK FIRST ORDER BY \u2026)<\/p>\n\n\n\n<p>\u2022KEEP (DENSE_RANK LAST ORDER BY \u2026)<\/p>\n\n\n\n<p>\u2022RANK()<\/p>\n\n\n\n<p>\u2022RANK() OVER<\/p>\n\n\n\n<p>\u2022RANK() OVER PARTITION BY<\/p>\n\n\n\n<p>\u2022DENSE RANK() OVER<\/p>\n\n\n\n<p>\u2022DENSE RANK() OVER PARTITION BY<\/p>\n\n\n\n<p>\u2022PARTITION BY \u2026. ORDER BY<\/p>\n\n\n\n<p>\u2022ROW_NUMBER() OVER (ORDER By \u2026)<\/p>\n\n\n\n<p>\u2022ROWS BETWEEN Unbounded Preceding<\/p>\n\n\n\n<p>\u2022CURRENT ROW<\/p>\n\n\n\n<p>\u2022RANGE BETWEEN INTERVAL 30 DAY PRECEDING AND INTERVAL \u201830\u2019 DAY Following<\/p>\n\n\n\n<p>\u2022ROWS BETWENN 1 PRECEDING and 1 FOLLOWING<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>oKEEP<\/p>\n\n\n\n<p>\u2013Aggregate by keeping<\/p>\n\n\n\n<p>oDENSE_RANK()<\/p>\n\n\n\n<p>oDENSE_RANK FIRST<\/p>\n\n\n\n<p>oDENSE_RANK LAST<\/p>\n\n\n\n<p>oOver()<\/p>\n\n\n\n<p>oOver Partition By<\/p>\n\n\n\n<p>\u2013Avg () OVER Partition BY<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>oROW_NUMBER<\/p>\n\n\n\n<p>oRANK()<\/p>\n\n\n\n<p>oDENSE_RANK<\/p>\n\n\n\n<p>oVariations<\/p>\n\n\n\n<p>\u2013RANK() OVER<\/p>\n\n\n\n<p>\u2013RANK() OVER PARTITION BY<\/p>\n\n\n\n<p>\u2013DENSE RANK() OVER<\/p>\n\n\n\n<p>\u2013DENSE RANK() OVER PARTITION BY<\/p>\n\n\n\n<p>\u2013PARTITION BY \u2026. ORDER BY<\/p>\n\n\n\n<p>\u2013(Partition \u2026 order by)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\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 \u2022Over Partition By \u2022Avg () &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=76666\">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":[1],"tags":[],"class_list":["post-76666","post","type-post","status-publish","format-standard","hentry","category-root","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":78165,"url":"http:\/\/bangla.sitestree.com\/?p=78165","url_meta":{"origin":76666,"position":0},"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":75992,"url":"http:\/\/bangla.sitestree.com\/?p=75992","url_meta":{"origin":76666,"position":1},"title":"Oracle Advanced SQL Clauses","author":"Sayed","date":"May 4, 2024","format":false,"excerpt":"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 \"PR\", ROW_NUMBER() OVER (ORDER BY PRICE) as \"PR\" DENSE_RANK() OVER (ORDER BY C DESC NULLS LAST) as \"R\" DENSE_RANK() OVER (PARTITION by C ORDER BY P) as\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69418,"url":"http:\/\/bangla.sitestree.com\/?p=69418","url_meta":{"origin":76666,"position":2},"title":"Why PostGress better than FireBird: This comparison may not be accurate though. #2","author":"Author-Check- Article-or-Video","date":"August 20, 2021","format":false,"excerpt":"Postgres Vs Interbase\/Firebird (Score:0) By Anonymous Reader on 2004.12.03 18:23 (#102740) http:\/\/www.vitavoom.com\/postgresql.htmlFirebird has not true text type you must use the clumsy blobs and weird blob subtypes.Postgres is much closer for enterprise use than Firebird.almost all of this applies to Firebird as well as interbase.PostgreSQL vs InterbasePostgreSQL... * ... has\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78217,"url":"http:\/\/bangla.sitestree.com\/?p=78217","url_meta":{"origin":76666,"position":3},"title":"Model Selection","author":"Sayed","date":"May 21, 2025","format":false,"excerpt":"\u2022 Optimizations\/Machine Learning\/Data Mining\/Deep Learning\/Reinforcement Learning\/Graph Mining\/NLP\/Genetic Algorithms \u2022 Regression \u2022 Linear \u2022 Non-Linear \u2022 Classifications \u2022 Logistics Regression \u2022 Sigmoid : Binary \u2022 Softmax: Multi-Class \u2022 Bayes Classifier \u2022 SVM \u2022 Bayesian: Regression\/Classification \u2022 Clustering \u2022 K-NN \u2022 KNN+ \u2022 Kmeans, Hierarchical, Density \u2022Machine Learning\/Data Mining\/Deep Learning\/Reinforcement Learning\/Graph Mining\/NLP\u2026","rel":"","context":"In &quot;Analytics and Machine Learning Project Development&quot;","block_context":{"text":"Analytics and Machine Learning Project Development","link":"http:\/\/bangla.sitestree.com\/?cat=1974"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":78455,"url":"http:\/\/bangla.sitestree.com\/?p=78455","url_meta":{"origin":76666,"position":4},"title":"Visual Comparison of Flat vs Hierarchical DNS Namespaces","author":"Sayed","date":"September 8, 2025","format":false,"excerpt":"Visual Comparison of Flat vs Hierarchical DNS Namespaces 1. Flat DNS Namespace example.com \u251c\u2500\u2500 server1.example.com \u251c\u2500\u2500 server2.example.com \u251c\u2500\u2500 printer1.example.com \u2514\u2500\u2500 laptop-john.example.com All hosts are directly under the main domain. Simple, but hard to scale for larger networks. 2. Hierarchical DNS Namespace example.com \u251c\u2500\u2500 hr.example.com \u2502 \u251c\u2500\u2500 server1.hr.example.com \u2502 \u2514\u2500\u2500 server2.hr.example.com\u2026","rel":"","context":"In &quot;Computer Networks&quot;","block_context":{"text":"Computer Networks","link":"http:\/\/bangla.sitestree.com\/?cat=1978"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26191,"url":"http:\/\/bangla.sitestree.com\/?p=26191","url_meta":{"origin":76666,"position":5},"title":"Hierarchical Visualization: Examples, Implementations, Theory, and Projects #Root","author":"Author-Check- Article-or-Video","date":"April 19, 2021","format":false,"excerpt":"Hierarchical Visualization Hierarchical Visualization in R http:\/\/www.r-chart.com\/2010\/07\/hierarchical-visualizations-in-r-and.html Hierarchical cluster analysis on famous data sets - enhanced with the dendextend package https:\/\/cran.r-project.org\/web\/packages\/dendextend\/vignettes\/Cluster_Analysis.html Tree Plots https:\/\/plot.ly\/python\/tree-plots\/ A Python framework for the analysis and visualization of trees. http:\/\/etetoolkit.org\/ Hierarchy https:\/\/en.wikipedia.org\/wiki\/Hierarchy Organizational Chart https:\/\/upload.wikimedia.org\/wikipedia\/commons\/8\/86\/Departments_in_advertising_agencies.jpg Brackets https:\/\/en.wikipedia.org\/wiki\/Bracket_(tournament)#\/media\/File:SixteenPlayerSingle Introduction to Graphs http:\/\/btechsmartclass.com\/data_structures\/introduction-to-graphs.html https:\/\/www.csee.umbc.edu\/courses\/undergraduate\/341\/fall98\/frey\/ClassNotes\/Class14\/RootedTree.jpg Tree Data Structure\u2026","rel":"","context":"In &quot;Data Visualization&quot;","block_context":{"text":"Data Visualization","link":"http:\/\/bangla.sitestree.com\/?cat=1903"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76666","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=76666"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76666\/revisions"}],"predecessor-version":[{"id":76667,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/76666\/revisions\/76667"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76666"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}