Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个子表 task_details havin 主键 tid,n 一列状态 na 外键 pid(项目表主键)
我只想访问那些所有任务(tid)必须完成的pid(status='Completed'),如果任何项目的任何任务不完整,即(status='Running')它不会返回那个pid] 注意每个prr
其带有 where 条件的简单选择查询
select * from table where status='Completed'
或者
如果提交的状态是其他项目表的一部分
select t.tid,t.pid FROM TASK_DETAILS as t inner join Project_details as p on t.pid = p.pid where p.Status = 'Completed'