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.
「機能」という名前の次のテーブルがあります。
id feature ----------------------- 1 aa 2 bb 3 cc 4 dd 5 ee 6 ff
区切り文字列に基づいてこのテーブルをクエリする方法はありますか? 何かのようなもの:
select * from features where {some magic here} = "1,4,5"
対応するレコードのみを返す必要があるのはどれですか?
何を求めているのか 100% 確実ではありません。一連の ID に一致するすべてのレコードを取得しようとしていますか、それとも特定の文字列を含む機能を探していますか?
前者の場合:
select * from features where id in (1,4,5);
後者の場合:
select * from features where feature like '%1,4,5%';