HomeНаука и техникаRelated VideosMore From: The Magic of SQL

Hierarchical Queries: Databases for Developers #16

35 ratings | 2210 views
Often data contains a parent-child relationship between rows in the same table. For example, company org charts and family trees. You can use the power of SQL to traverse these hierarchical relationships. There are two ways to do this in Oracle Database: - Connect By - Recursive With Watch this video to learn about data trees and find out how these work! Further reading: Hierarchical queries in the docs: https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/Hierarchical-Queries.html#GUID-0118DF1D-B9A9-41EB-8556-C6E7D6A5A84E Recursive subquery factoring in 11.2: https://oracle-base.com/articles/11g/recursive-subquery-factoring-11gr2 Take the course! https://devgym.oracle.com/pls/apex/dg/class/databases-for-developers-next-level.html Need help with SQL? Ask us over on AskTOM: https://asktom.oracle.com Twitter: https://twitter.com/ChrisRSaxon Daily SQL Twitter tips: https://twitter.com/SQLDaily All Things SQL blog: https://blogs.oracle.com/sql/ ============================ The Magic of SQL with Chris Saxon Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Html code for embedding videos on your blog
Text Comments (5)
aggrey afray (2 months ago)
hi just inquiry can i use those functions in mysql and php?
The Magic of SQL (2 months ago)
MySQL does support recursive with/CTEs. I'm not sure if/how it covers all the features discussed here though.
Attaullah Khan (2 months ago)
how to to do this in php mysqli http://jsfiddle.net/Limitlessisa/5Lhb0ron/ can you make it dynamic please
Edgard Sulyma (2 months ago)
Fantastic video!! it's 8pm here at my office and I'm dancing because this function has helped me a lot.
The Magic of SQL (2 months ago)
Awesome :) Got a video of you dancing? ;)

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.