If a table has a column "dept" (declared to have nulls) and
there are 10 rows in the table of which 3 have a null value
in the dept column, what will select count(*) and select
count(distinct dept) return?
Answer Posted / madhuri tungal
select count(*) returns 10 --- this is right. But,
select count(distinct dept) returns 7. Because null values
are not considered as distinct.
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What is a db2 tablespace?
What is db2 and what is the use of db2 optimizer?
Which are the db2 tools to protect integrity of the database?
what is a corelated subquerry?
What is deadlock in db2?
Is it possible using max on a char column?
List out the three types of page locks that can be held.
How would you find out the total number of rows in a db2 table?
What is copy pending and check pending in db2?
Where can you declare a cursor in a cobol-db2 program?
Mention data types used in db2 ?
How can you find out the # of rows updated after an update statement?
Explain the function done by data manager?
How to execute stored procedures?
Explain about rct.