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
Define data page.
What is lock escalation in db2?
What is iseries database?
What is syscat in db2?
What is database alias db2?
What is cursor in dbms?
What are the rules for db2 programming?
What is check constraint. Explain with example.
What is ibm db2 client?
What is the result of open cursor statement?
How to take backup of table in db2?
Comment whether the cursor is closed during commit or not.
Explain the contents that are a part of dclgen.
What is the use of value function?
What is a system catalog table in db2?