首页 > 数据库 > Oracle > OCP 1Z0-051-108
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.
答案:(B、D)
解析:
C(X),包含重复的值,但不包含空值。
E(X),可以有WHERE子句,先过滤掉不需要的行。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1164754/ ,如需转载,请注明出处,否则将追究法律责任。