select distinct(empid),distinct(dept),name
from EMP
will the above query work?
Answer Posted / harsha
No, It will not work. SELECT DISTINCT works only for single
cloumn.
DISTINCT can be applied multiple times only when you want
to apply aggregate functions such as COUNT, AVG & SUM.
e.g.
SELECT COUNT(EMPNO)/COUNT(DISTINCT(WORKDEPT)), COUNT
(DISTINCT(JOB))
FROM DSN8810.EMP
| Is This Answer Correct ? | 14 Yes | 1 No |
Post New Answer View All Answers
Is db2 a mainframe?
What is explain in db2?
How to create backup table in db2?
How is deadlock resolved?
Mention the different locking levels that are available in db2.
What is the result of open cursor statement?
What is host variable in db2 cobol?
What is ibm db2 client?
What are db2 objects?
Before you give the explain statement, what are the prerogatives?
What is the function of logging in the db2 database?
How do I optimize a query in db2?
What is the use of value function?
What is package in cobol db2?
What is bufferpool in db2?