108. Which two statements are true regarding the COUNT function? (Choose two.)
A. The COUNT function can be used only for CHAR, VARCHAR2, and NUMBER data types.
B. COUNT(*) returns the number of rows including duplicate rows and rows containing NULL value in
any of the columns.
C. COUNT(cust_id) returns the number of rows including rows with duplicate customer IDs and NULL
value in the CUST_ID column.
D. COUNT(DISTINCT inv_amt)returns the number of rows excluding排除在外 rows containing duplicates and
NULL values in the INV_AMT column.
E. A SELECT statement using the COUNT function with a DISTINCT keyword cannot have a
WHERE clause.
COUNT
returns the number of rows returned by the query. You can use it as an aggregate or analytic function.你可以用它作为一个聚合函数或解析函数
If you specify DISTINCT
, then you can specify only the query_partition_clause
of theanalytic_clause
. Theorder_by_clause
and windowing_clause
are not allowed.
If you specify expr
, then COUNT
returns the number of rows whereexpr
is not null. You can count either all rows, or only distinct values ofexpr
.
If you specify the asterisk (*), then this function returns all rows, including duplicates and nulls. COUNT
never returns null.