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
What is cursor stability in db2?
What is the result of open cursor statement?
How can you quickly find out the # of rows updated after an update statement?
In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?
What is host variable?
what are bind concepts in db2 cobol?
What are the bind parameters ibm db2?
What is coalesce in db2?
Who uses db2?
What are foreign keys in db2?
What are the different types of base tables?
What is the difference between db2 and oracle?
How can record locking be achieved in those DB2 versions which do not support it?
Explain about mirror activator disk mirroring?
What are packages in db2?