728x90

SELECT count(*) as USERS
from USER_INFO
where year(JOINED)=2021 and age>=20 and age<=29
▶ 조건에 맞는 값 개수 세기 : count(*) as 별칭
▶ 조건식 between : 컬럼명 between 숫자 1 and 숫자 2
▶연도만 출력하기 : year(컬럼명) = 연도네자리
month : 월
datofmonth :
728x90
'• programming language > SQL' 카테고리의 다른 글
MYSQL workbench 삭제후 재설치/port 3306 is already in use 해결방법 (1) | 2024.01.29 |
---|---|
[해결방법] SQL Error [1366] [22007]: (conn=43) Incorrect string value: '\xEC\x9D\xB4\xEC\x8A\xB9...' for column `sqldb`.`usertbl`.`name` at row 1 (0) | 2024.01.29 |
[프로그래머스_SQL] 상위 n개 레코드 (0) | 2024.01.07 |
[프로그래머스_SQL] 여러 기준으로 정렬하기 (1) | 2024.01.07 |
[프로그래머스_SQL] 동물의 아이디와 이름 (0) | 2024.01.03 |