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 it compulsory commitment control in journal?
Explain about mirror activator disk mirroring?
Explain about rct.
Explain in brief how does db2 determine what lock-size to use?
What's The Percentage Free Space ?
How to check table size in db2 sap?
How can you count the number of rows from a table tab?
What is the difference between drop table and delete table?
What is buffer pool?
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
What is catalog database in db2?
What does db2 plan contain?
what is the sqlcode -501
How do I create a view in db2?
How to rename a table in DB2 ?