[오라클]컬럼 지정조건 값 카운트
2021. 1. 30.
select name_code,
count(DECODE(survey_point, '5', '1' , '0'))
From statistics
where
reg_date between '2018-mm-dd' and '2018-mm-dd'
group by (name_code)
;
Decode대신
...
case when A=x then y [else Z] END
'DB' 카테고리의 다른 글
| [SQL function] 거리 계산 함수 (0) | 2022.10.27 |
|---|---|
| [오라클] DB 에러 : table SYS.AUD$ by 8192 in tablespace (0) | 2022.04.21 |
| [Rank] 특정 컬럼으로 순위 매기기 「RANK() OVER 」 (0) | 2022.03.04 |
| [DB링크] CLOB 테이블 DB링크로 데이터없이 복사하기 (0) | 2021.02.02 |
| 테이블 컬럼명 select 조회용으로 (0) | 2021.01.30 |