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 x WHERE id != for(int i : arraylist)
したがって、基本的に私は10個のIDを持つarraylistを持っています。SQLがarraylistと同じIDを持つ行を返さないようにしたいので、10個のクエリでそれを行いたくありません。これを行う方法はありますか?
この上:
SELECT * FROM x WHERE id not in ( list of value ) // i.e. 'A', 'B', ...
注意: このステートメントは、yuo 配列が満たされている場合にのみ実行できます。
NOT IN の項目がない配列があると、問題が発生する可能性があります。
そのため、NOT IN 句を配置する前に条件を確認する必要があります。