서브쿼리를 이용한 초간단 통계 쿼리 예제
SELECT SUM( DECODE(hope,1,1,0) hope1, DECODE(hope,2,1,0) hope2, DECODE(hope,3,1,0) hope3, DECODE(hope,4,1,0) hope4 ) FROM cist_app GROUP BY hope;
서브쿼리를 이용한 초간단 통계 쿼리 예제
SELECT SUM( DECODE(hope,1,1,0) hope1, DECODE(hope,2,1,0) hope2, DECODE(hope,3,1,0) hope3, DECODE(hope,4,1,0) hope4 ) FROM cist_app GROUP BY hope;
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
7 | Database | [mysql] 쿼리 실행시 ERROR 1366 (HY000) : incorrect string value : for column 3 | hooni | 2017.03.30 | 8782 |
6 | Database | [oracle] Oracle 사용자 추가 절차 | hooni | 2019.11.22 | 618 |
5 | Database | [oracle] SQL문 실행 방법 3가지 | hooni | 2013.12.19 | 12123 |
4 | Database | [sql] 간단한 SQL 문법 정리 | hooni | 2003.04.23 | 12551 |
» | Database | [sql] 간단한 통계 서브쿼리 예제.. | hooni | 2013.04.23 | 15088 |
2 | Database | [sql] 쿼리로 문자열 검색해서 일괄 치환하기 | hooni | 2014.02.13 | 9970 |
1 | Database | [sql] 한눈에 보이는 Join | hooni | 2014.02.19 | 8463 |