일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- null
- 이클립스
- MYSQL
- jquery
- 웹 플랫폼 설치 관리자
- RADIO
- 오라클
- spring form tag
- json
- 네이버스마트 에디터
- checbox
- JSTL
- exception
- 호환성
- DB
- Oracle
- HTML5
- 한글
- php
- 날짜
- 문자열
- SSL
- switch
- 톰캣
- html
- maven
- @RequestBody
- java
- 스크립트
- 전자정부 표준프레임워크
- Today
- Total
개인적인 정리
ORACLE COUNT() 본문
오라클 COUNT()
COUNT returns the number of rows returned by the query. You can use it as an aggregate or analytic function
If you specity DISTINCT, then you can sepcify only the query_partition_clause of the analytic_clause. The order_by_clause and windowing_clause are not allowed.
If you speify expr. then COUNT returns the number of rows where expr is not null. You can count either all rows, or only distinct values of expr.
If you specify the asterisk(*0 then this function returns all rows, including duplicates and nulls. COUNT never returns null.
많이 익숙한 함수.
COUNT 는 절대 NULL 을 리턴하지 않는다.
Aggregate Examples
SQL > SELECT COUNT(*) AS TOTAL FROM EMPLOYEES ;
--> 107
Analytic Example
The following example calculages, for each employee in the employee table, the moving count of employees earning salaries in the range 50 less than througn 150 greater than the employee's salary.
SQL > SELECT last_name, salary,
COUNT(*) OVER(ORDER BY salary RANGE BETWEEN 50 PRECEDING AND 150 FOLLOWING) AS mov_count
FROM employees
ORDER BY salary, last_name ;
SQL > SELECT last_name, salary,
COUNT(*) OVER(ORDER BY salary ) AS mov_count
FROM employees
ORDER BY salary, last_name ;
'DB > ORACLE' 카테고리의 다른 글
ORACLE DELETEXML() (0) | 2020.03.26 |
---|---|
ORACLE DECODE() (0) | 2020.03.26 |
ORACLE CURRENT_TIMESTAMP() (0) | 2020.03.26 |
ORACLE CURRENT_DATE() (0) | 2020.03.26 |
ORACLE COS() (0) | 2020.03.26 |
ORACLE CONCAT() (0) | 2020.03.25 |
ORACLE COLLECT() (0) | 2020.03.25 |
ORACLE COALESCE() (0) | 2020.03.25 |