日期:2014-05-17  浏览次数:20788 次

树形结构SQL
SQL code

A表:
org_id    org_name   p_id


B表:
org_id          user_id


C表:
user_id     user_name


D表:
user_id      user_pic    state


分别根据user_name,org_name, state,三个字段查找user_name,user_pic,org_name结果集


------解决方案--------------------
探讨
引用:

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 ……