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?

More than 3 years have passed since last update.

IN演算子 SQL

Posted at

用途

複数の値に一致するレコードを取り出す場合に使用する

使用方法

select * from テーブル名 where カラム名 in ('値1', '値2', '値3', ...);

例 hogeテーブル

id name color
1 山田
2 鈴木
3 吉田
4 田中
5 渡辺
6 清水
sql
select * from hoge where color in ('青', '白', '黒');

結果

id name color
2 鈴木
5 渡辺
6 清水

 
 
 
この記事は以下の情報を参考にして執筆しました。

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?