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 を持っています主キー tid、n 1 つの列ステータス na 外部キー pid(プロジェクト テーブル主キー)
すべてのタスク (tid) が完了 (status='Completed') しなければならない pid のみにアクセスしたい プロジェクトのいずれかのタスクが未完了 (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'