The BETWEEN keyword
Coddy SQL 여정의 기초 섹션에 포함된 레슨 — 72개 중 19번째.
지금까지는 특정 필드의 범위를 지정하기 위해 크다 >와 작다 <를 사용하는 법을 배웠습니다.하지만 또 다른 방법이 있습니다.
다음과 같이 작성하는 대신:
WHERE col1 >= 5 AND col1 <= 10다음과 같이 작성할 수 있습니다:
WHERE col1 BETWEEN 5 AND 10BETWEEN 연산자는 경계값(이 경우 5와 10)을 결과에 포함하는 포괄적(inclusive) 연산자입니다. 이를 통해 특히 날짜 범위나 숫자 간격을 다룰 때 SQL 쿼리를 더욱 깔끔하고 읽기 쉽게 작성할 수 있습니다.
챌린지
쉬움사용 가능한 테이블과 열:
<strong>data</strong>:<strong>value</strong>
value 열의 값이 7과 13 사이인 모든 레코드를 가져오세요.
직접 해보기
이 레슨에는 짧은 퀴즈가 포함되어 있습니다. 레슨을 시작해 문제를 풀고 진행 상황을 기록하세요.
기초의 모든 레슨
4More Keywords
The IN keywordThe BETWEEN keywordThe LIKE keywordThe AS keywordRecap - Cellphone Models2Conditions
Conditions BasicsThe AND keywordThe OR keywordThe NOT keywordMultiple Conditions CombinedParenthesisBooleans5Arithmetic Operations
Mathematical OperatorsMathematical ColumnsThe Modulo OperationThe ROUND() Function3Specific Return Format
Null valuesSort Results Part 1Sort Results Part 2Recap - Cyber Security FirmLimit number of recordsRecap - Vehicle Factory6Intro Challenges
Recap - Parliamentary ElectionRecap - Police Criminal ArrestRecap - Bar Beverage ContainerRecap - Engineer new columns