Oracle OCP认证-Oracle OCM认证

您当前的位置:优技教育 > ocp考试 >

ocp 11g认证题库大全:1Z0-051-108题

来源:优技教育

ocp 11g认证题库大全:1Z0-051-108题,完整题库请点击这里联系老师咨询了解

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.

Answer: BD

试题解析:

COUNT函数有以下三种格式:

 COUNT(*)

 COUNT(expr)

 COUNT(DISTINCT expr)

COUNT(*)用于返回表中符合SELECT语句标准的行数,包括重复行和在任何列中含有空值的行。

如果SELECT语句中包含WHERE子句,则COUNT(*)会返回符合WHERE子句中条件的行数。

相反,COUNT(expr)返回由expr标识的列中非空值的数量。

COUNT(DISTINCT expr)返回由expr标识的列中不同非空值的数量。

精华阅读