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 kind of database is db2?
Where can you declare a cursor in a cobol-db2 program?
What action db2 takes when a program aborts in the middle of a transaction?
What is cursor stability in db2?
What is a collection in db2?
What is reorg and runstats in db2?
Define declaration generator (dclgen).
What is a db2 tablespace?
Explain about open switch business continuity software?
What is image copy in db2?
What is dbrm? When it will be created?
What is collection in db2 bind?
What is bind plan?
What is the use of commit in db2?
What is deadlock in db2?