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
Give the name of some fields form sqlca.
What do you mean by storage group (stogroup)?
What is meant by union and union all?
What is cascading rollback?
what is a corelated subquerry?
What are the full forms of spufi and dclgen and why are they used?
Define predicate?
How is deadlock resolved?
What is db2 bind process?
What is iseries database?
What are the contents of dclgen?
What types of tables are there in the db2 database?
How can the firstname and the lastname from the emp table be concatenated to generate complete names?
What happens in bind step in a db2 program?
i want to maintain uniqueness on pdf without make lf??????????