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 an instance database?
What is performance tuning db2?
What is collection in db2 bind?
how to unload different table data into different gdg files/ vsam files.
In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?
What is meant by the attachment facility?
What is the command used by TSO users to invoke DB2?
What is the use of DELGEN in DB2? Can we Write the program with out using it?
what is check point and restart Logic ? why do we go for that ??
could you give me an example how, where i code CHECKPOINT and restart...I need and example....thanks..
what is dynamic cursor?gives syntax for this?
How to compare data between two tables in db2?