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
Which is faster delete or truncate?
What is consistency token in db2?
List out the buffer pools in db2
What is plan in cobol db2?
What is scrollable cursor in db2?
what is the role of the cursor in db2?
What is rebind in db2?
What is dclgen (declaration generator)?
What is difference between isnull and coalesce?
What is view db2?
What is runstats db2?
What is the difference between bind and rebind in db2?
What is a plan and package in db2?
Are views updateable?
What is dbrm in db2 database?