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

Describe major components of db2?

640


What is iseries database?

597


What is the difference between nvl and coalesce?

600


What is the role of union all and union

650


What is the maximum No of rows per page?

626






Explain correlated sub-queries.

588


What is concurrency?

709


What is the use of db2?

586


What is sqlca’s maximum length?

674


What is nvl in db2?

626


How do I add a column to a table in db2?

618


What is the difference between using bind () and rebind () methods of naming class?

791


What is query_cache_limit?

543


What is the use of commit in db2?

630


What is the maximum number of columns in a db2 table?

723