728x90
SQL IN
SQL IN 은 WHERE 문 후에 특정한 value를 선택 할 수 있다.
SQL IN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,value2,...);
FROM table_name
WHERE column_name IN (value1,value2,...);
만약 City 컬럼에 Paris와 London을 선택한 정보를 보려면
SELECT * FROM Customers
WHERE City IN ('Paris','London');
결과:
19 | Eastern Connection | Ann Devon | 35 King George | London | WX3 6FW | UK |
53 | North/South | Simon Crowther | South House 300 Queensbridge | London | SW7 1RZ | UK |
57 | Paris sp�ialit� | Marie Bertrand | 265, boulevard Charonne | Paris | 75012 | France |
72 | Seven Seas Imports | Hari Kumar | 90 Wadhurst Rd. | London | OX15 4NB | UK |
'my_lesson > _SQL' 카테고리의 다른 글
SQL - Injection (0) | 2016.02.25 |
---|---|
SQL - LIKE (0) | 2016.02.25 |
SQL - BETWEEN (0) | 2016.02.25 |
SQL - JOIN (0) | 2016.02.25 |
SQL - LEFT JOIN (0) | 2016.02.25 |
댓글