0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【SQL】FIND_IN_SET()とは ※主にWHERE句

Last updated at Posted at 2022-02-15

#FIND_IN_SET(検索文字,カンマ区切り文字)

【カンマ区切り文字列】に、検索したい文字列が含まれてたら、1~Nまでの値を返す。


SELECT find_in_set('1', '1,2,3,4')
1
SELECT find_in_set('2', '1,2,3,4')
2
SELECT find_in_set('3', '3')
1
SELECT find_in_set('', '1,2,3,4')
0

#whereのFIND_IN_SET()

WHERE FIND_IN_SET(?, S.archetype1_id) > 0

    ->where('FIND_IN_SET('.$id.', senyou_artifact_id)');

■参考サイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?