表名稱 為:egg_school_en_user_data_word_log例如以上的圖相同ID 'wextid' 下 某一列 'result' 全部等于 error 的正確將查詢出 wextid 為 5528 的數據 而 wextid 為 2628 的數據 因為其中有一行 'result' 為 correct 所有不應該被查處。我的目的 是指 在 wextid 相同情況下,result 必須全部為 error 的值。 我需要的是 如果上圖中 第 5行(ID為730) 的 result 變成error 那么將查詢出 5528,2628 個值 的SQL語句。
2 回答
收到一只叮咚
TA貢獻1821條經驗 獲得超5個贊
select * from (select wextid,result from t_test group by wextid,result) a group by wextid having count(1)=1 and result = 'error'
狐的傳說
TA貢獻1804條經驗 獲得超3個贊
select * from egg_school_en_user_data_word_log a where not exists(select wextid from egg_school_en_user_data_word_log b where a.wextid=b.wextid and b.result="correct");
- 2 回答
- 0 關注
- 1086 瀏覽
添加回答
舉報
0/150
提交
取消
