select c.user_name,d.user_pic,a.org_name from A a ,B b,C c,D d where a.org_id =b.org_id and b.user_id =c.user_id and c.user_id = d.user_id and c.user_name =? and a.org_name = ? and d.state =?试试看
select c.user_name,d.user_pic,a.org_name from A a ,B b,C c,D d where a.org_id =b.org_id and b.user_id =c.user_id and c.user_id = d.user_id and b.user_id = d.user_id and c.user_name =? and a.org_name = ? and d.state =? 这个你试试看
select c.user_name,d.user_pic,a.org_name from A a ,B b,C c,D d where a.org_id =b.org_id and b.user_id =c.user_id and c.user_id = d.user_id and and a.org_name like ‘%a%’
and d.state =?试试看
分别根据user_name,org_name, state,也就是三个SQL语句1.根据user_name查询user_name,user_pic,org_name结果集
2.根据org_name查询user_name,user_pic,org_name结果集
3.根据state查询user_name,user_pic,org_name结果集
org_id org_name p_id
1 a 0
2 a1 1
3 a2 1这样,查找org_name为a,要把下面子节点(a1,a2)的都展示出来
and c.user_name =? and a.org_name = ?
and d.state =?
这个你试试看
CONNECT BY PRIOR
START WITH语法