当前位置: 代码迷 >> Java Web开发 >> 求一条SQL语句 搞昏了解决方法
  详细解决方案

求一条SQL语句 搞昏了解决方法

热度:10   发布时间:2016-04-17 12:55:52.0
求一条SQL语句 搞昏了
一张表   就person_ID和project_ID   他们是联合主键
怎么样   根据人员ID   查处他所在project中   的所有人员的ID

------解决方案--------------------
select person_id from table_name where project_id in (
select project_id from table_name where person_id=你给出的值;


)
------解决方案--------------------
有那么晕吗〉赫赫
------解决方案--------------------
select person_id from project where project_id in(select project_id from project where persion_id=值)
------解决方案--------------------
select person_id from project where project_id in(select project_id from project where persion_id=人员ID 值)

------解决方案--------------------
很简单的啊
------解决方案--------------------
是啊不难啊!!!
------解决方案--------------------
select person_id from tablename where project_id =(select project_id from tablename where person_id=***);
  相关解决方案