select distinct(empid),distinct(dept),name
from EMP
will the above query work?
Answer Posted / chidambara subbu
No, It will not work. We can select DISTINCT values for
multiple columns however not all the columns will give
ditint value. For intance , see below table TABLE1
Name City
XXX Chennai
FFF HYD
XXX Blore
YYY Mumbai
1.SELECT DISTINCT NAME FROM TABLE1
Name
XXX
FFF
YYY
2. SELECT DISTINCT NAME,City FROM TABLE1
Name City
XXX Chennai
FFF HYD
XXX Blore
YYY Mumbai
See the result of second query. It has selected duplicate
entry 'XXX' in the Name column.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the max length of sqlca?
What is db2 instance?
What is a Foreign Key?
What is the physical storage length of time data type?
How do I delete a table in db2?
What is null indicator in db2?
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
What is image copy in db2?
What is bind and rebind in db2?
What is catalog database in db2?
What do you mean by commit and rollback?
Can we delete records from view?
Before you give the explain statement, what are the prerogatives?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
How can deadlocks be resolved?