Table A
| ITEMNO | COLORNO |
--------------------
| 1 | 4 |
| 2 | 70 |
| 3 | 9 |
itemNo colorNo
1 3
1 4
2 4
2 70
3 9
3 10
Try
SELECT *
FROM A
WHERE (itemNo = '1' AND colorNo = '4')
OR (itemNo = '2' AND colorNo = '70')
OR (itemNo = '3' AND colorNo = '9')
or you can also do thisSELECT *
FROM A
WHERE (itemNo, colorNo) IN ((1, 4),(2, 70),(3, 9))
Output:| ITEMNO | COLORNO |
--------------------
| 1 | 4 |
| 2 | 70 |
| 3 | 9 |
0 comments:
Post a Comment