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?
Answers were Sorted based on User's Feedback
Answer / virender
SELECT(*) Will return 10 and SELECT (distinct dept) will
return 8.
Is This Answer Correct ? | 7 Yes | 2 No |
Answer / 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 |
Answer / abhilash
SELECT(*) Will return 10 and SELECT (distinct dept) will
return 8.
Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between plan and package in db2?
is there any restrictions for unions ?
How to update more then one record using update?
What is a DB2 bind?
How can we define a table? How can we apply SEARCH ALL on it ?
What are the various locks available?
What is the error code -803 ?
Write a query to extract first 5 characters of a name in the column Stud_Name?
How can the duplicate values be eliminated from db2 select?
What is lock escalation?
How to solved 818 error
4 Answers Keane India Ltd, Wipro,
What is the picture clause of null indicator variable?