試題選項表t_ems_item_option中有item_id試題id,option_id選項id,is_correct是否正確答案
例如
item_id option_id is_correct
試題1 a f
試題1 b f
試題1 c f
試題1 d t
試題2 a f
試題2 b f
試題2 c f
試題2 d f
求找到試題2
uj5u.com熱心網友回復:
select distinct item_id from t_ems_item_option
where item_id not in ( select item_id from t_ems_item_option where is_correct = true )
uj5u.com熱心網友回復:
select item_idfrom t_ems_item_option
where item_id not exists
( select item_id from t_ems_item_option where is_correct = true )
group by 1;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/85505.html
標籤:PostgreSQL
上一篇:Mysql觸發器的問題
