The COUNT function in Oracle is used to count non-null values in a specified column or expression. The syntax is COUNT(DISTINCT
) or COUNT(*), which calculates unique values and all non-null values respectively. number.
Usage of COUNT function in Oracle
The COUNT function is used to calculate non-null values in the specified column or expression. number. The syntax is as follows:
<code class="sql">COUNT(DISTINCT <column_name>) COUNT(*)</code>
Parameter description:
Usage example:
<code class="sql">SELECT COUNT(DISTINCT employee_id) FROM employees;</code>
<code class="sql">SELECT COUNT(*) FROM employees;</code>
<code class="sql">SELECT COUNT(DISTINCT employee_id) FROM employees WHERE salary > 50000;</code>
Note:
The above is the detailed content of How to use count function in oracle. For more information, please follow other related articles on the PHP Chinese website!