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 dbrm? What it contains? When it will be created?
How to find schema of a table in db2?
How do I import a csv file into db2?
Which command is used to connect to a database in DB2 ? Give the Syntax.
What is the function of logging in the db2 database?
What is scrollable cursor in db2?
What is multi row fetch in db2?
Is ibm db2 open source?
What is lock escalation in db2?
what is utility for parm lib
Explain the contents that are a part of dclgen.
What is meant by dclgen?
What is sqlca’s maximum length?
Mention the various locks that are available in db2.
What is the purpose of rollback and commit?