配列の要素をMySQLのクエリのIN句に指定したい時。
const selectUsers = [ '田中', '鈴木', '木下' ];
const sql = 'SELECT * FROM users WHERE name IN (?)';
const res = await mysql.query(sql, [selectUsers]);
参考:
https://qiita.com/komatsu_1324/items/df1253fb3d4b3e312d17
Go to list of users who liked
More than 1 year has passed since last update.
配列の要素をMySQLのクエリのIN句に指定したい時。
const selectUsers = [ '田中', '鈴木', '木下' ];
const sql = 'SELECT * FROM users WHERE name IN (?)';
const res = await mysql.query(sql, [selectUsers]);
参考:
https://qiita.com/komatsu_1324/items/df1253fb3d4b3e312d17
Register as a new user and use Qiita more conveniently
Go to list of users who liked