조건에 맞는 행 추출

이용민·2022년 4월 12일
0

In

SELECT CustomerName, country   # CustomerName, Country 컬럼 선택
FROM Customers				   # Customers 테이블 선택
WHERE Country = 'Germany'	   # Country 컬럼이 Germany인 행만 추출

Out

CustomerName				Country
Alfreds Futterkiste			Germany
Blauer See Delikatessen		Germany
Drachenblut Delikatessend	Germany
Frankenversand				Germany
Königlich Essen				Germany
Lehmanns Marktstand			Germany

비교연산자를 통해 숫자뿐 아니라 문자도 비교 가능

CustomerName이 B보다 작은 문자(A)로 시작하는 행만 추출

In

SELECT CustomerName			
FROM Customers				
WHERE CustomerName < 'B'

Out

CustomerName
Alfreds Futterkiste
Ana Trujillo Emparedados y helados
Antonio Moreno Taquería
Around the Horn

출처 플랫폼 : www.w3schools.com

0개의 댓글