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


Please Help Members By Posting Answers For Below Questions

What is copy pending status in db2?

632


What is the use of with ur in db2?

615


How would the varchar column remarks defined?

631


What is catalog database in db2?

638


Which component is responsible for db2 startup and shutdown?

622






What is innodb buffer pool?

556


Mention some fields that are a part of sqlca.

596


How do you stop a db2 database in linux?

564


What is difference between rollback and commit?

616


What is collection in db2 bind?

569


What is a db2 tablespace?

594


How to connect to db2 database from windows command line?

560


Mention the location where the output received from explain statement is stored.

628


What db2 400?

671


How to get the ddl of a table in db2?

671