AWS 페이지 너무 리뉴얼? 됨;; 언제 사라질지 몰라 복사~
구문
SELECT expression [, ...]
FROM table[.index]
[ WHERE condition ] [ [ORDER BY key [DESC|ASC] , ...]
다양한 예제
SELECT *
FROM Orders
WHERE OrderID = 100
SELECT *
FROM Orders
WHERE OrderID = 100 and Address='some address'
SELECT *
FROM Orders
WHERE OrderID = 100 or pk = 200
SELECT *
FROM Orders
WHERE OrderID IN [100, 300, 234]
SELECT *
FROM Orders
WHERE OrderID > 1
SELECT *
FROM Orders
WHERE Address='some address'
SELECT *
FROM Orders
WHERE OrderID = 100 OR Address='some address'
SELECT OrderID, Total
FROM Orders
WHERE OrderID = 1
SELECT OrderID, Total
FROM Orders
WHERE OrderID = 1 OR OrderID = 2
SELECT OrderID, Total
FROM Orders
WHERE OrderID IN [1, 2, 3] ORDER BY OrderID DESC
SELECT OrderID, Total
FROM Orders
WHERE Total > 500
SELECT OrderID, Total
FROM Orders
WHERE Total IN [500, 600]
SELECT OrderID, Total
FROM Orders
WHERE Total BETWEEN 500 AND 600
SELECT Devices
FROM WatchList
WHERE Devices.FireStick.DateWatched[0] >= '12/12/19'
원문
'프로그래밍언어 > DB, SQL' 카테고리의 다른 글
디비버 많이 쓰는 단축키 (0) | 2024.05.30 |
---|---|
무료 DB관리툴 디비버 (0) | 2024.04.30 |
MariaDB 쿼리 계획(실행 계획) (0) | 2022.01.27 |
ERD Cloud 사용법 (0) | 2021.06.11 |
Select 절에서 SubQuery 사용하기 (0) | 2015.01.13 |
댓글