[PS] SQL 정리 (Lv. 1)
·
PS/Sql
특정 값만 제외하고 조회하고 싶을 때# intake_condition 중 Aged 값들만 제외하고 조회where intake_condition not in ('Aged')상위 n개 레코드만 조회하고 싶을 때# LIMIT 구문은 결과에서 몇 개의 행을 반환할 것인지 제한하는 구문SELECT a.namefrom animal_ins aorder by datetimelimit 1;(IF) 특정 값 여부가 NULL인 경우, 'N'으로 출력# CASE WHEN [조건] THEN [True일 때] ELSE [False일 때] ENDSELECT a.warehouse_id, a.warehouse_name, a.address, case when a.freezer_yn is null then 'N' else a...