SQL select rows with only a certain value in them

前端 未结 5 1410
半阙折子戏
半阙折子戏 2020-12-28 19:49

I have a table as such

Col 1 Col 2 Col 3
1       A     1
2       A     2
3       B     1
4       C     1
5       C     2
6       D     1

Ho

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-28 20:21

    What you are probably looking for is WHERE clause.

    SELECT * FROM YouTable WHERE col3 = 1 AND col2 in ('B','D');
    

提交回复
热议问题