i am reading this article about saving trees into database
http://www.dba-oracle.com/t_sql_patterns_trees.htm
But i don’t understand for example this
select e1.ename from emp e1, emp e2
where e1.path like e2.path || '%'
and e2.ename = 'JONES'
What does mean this: e1.path like e2.path || '%'
I don’t understand using boolean operator in that query. I know ‘%’ is (.*) in reqular expression. Its looks for me like: (e1.path == e2.path) or (e1.path == whateverIWant).
Thx for hlp.
%is a wildcard in a SQL like expression, so it meanse1.pathshould start withe2.path.e1.pathis therefore a child ofe2.path.This query retrieves all the subordinates of employee
JONES.