0
0

MySQLでIN句を使う

Last updated at Posted at 2024-04-11

概要

SETで変数を指定してINで条件を絞り込みたい場合は、FIND_IN_SETを使うと良い。

SET @customers = '010687,009841,010469,007352,007353,007354,008654,009484,012255';

SELECT * FROM M_CUSTOMER
WHERE FIND_IN_SET(CUSTOMER_CODE, @customers)
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