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.
私はこのような選択クエリを持っています
SELECT * FROM table WHERE id = ?
特定の結果を除外する条件が必要です。 if(type = 'tv' and that type's code = '123') 次に、その行を選択結果から除外します。私は SQL のスキルがあまり高くないので、それを実現する方法がわかりません。
if(type = 'tv' and that type's code = '123')
SELECT * FROM table WHERE id = ? AND not(type = 'tv' and code = '123')
これはあなたが探しているものですか?
との間には違いが type <> 'tv' and code <> '123' あり ますnot(type = 'tv' and code = '123')
type <> 'tv' and code <> '123'
not(type = 'tv' and code = '123')