Comments on: Oracle RDBMS 11gR2 – new style hierarchical querying using Recursive Subquery Factoring https://technology.amis.nl/2009/09/29/oracle-rdbms-11gr2-new-style-hierarchical-querying-using-recursive-subquery-factoring/ Friends of Oracle and Java Sat, 01 Aug 2015 11:10:05 +0000 hourly 1 http://wordpress.org/?v=4.2.3 By: J https://technology.amis.nl/2009/09/29/oracle-rdbms-11gr2-new-style-hierarchical-querying-using-recursive-subquery-factoring/#comment-5941 Tue, 06 Sep 2011 08:36:44 +0000 http://technology.amis.nl/blog/?p=6267#comment-5941 Hi,
How would you use the above with the following use-case:
I need to return a full tree structure where a like match is done on a name column. The data would look like
manId | empID | name
1 Paul
1 2 Kara
1 3 Matthew
1 4 Bill
2 5 Gary
2 6 Paul
3 7 Sally
3 8 Sarah
4 9 Jill
4 10 Sarah
 
so the strucure is
 
– 1. Paul
– 2. Kara
– 5. Gary
– 6. Paul
– 3. Matthew
– 7. Sally
– 8. Sarah
– 4. Bill
– 9. Jill
– 10. Sarah
 
and I’d like to be able to search for where lower(name) like ‘%sarah%’ and have the following returned:
 
– 1. Paul
– 3. Matthew
– 8. Sarah
– 4. Bill
– 10. Sarah
 
likewise I’d like to be able to search where lower(name) like ‘%matthew%’ and have the following returned:
 
– 1. Paul
– 3. Matthew
– 7. Sally
– 8. Sarah
 
Possible?

]]>