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
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
What is null indicator in db2?
Can you use max on a char column?
How to get the ddl of a table in db2?
What is reorg?
What are the rules for db2 programming?
Which command is used to remove all rows from a table?
What does runstats do in db2?
What is a db2 tablespace?
What does a deadlock mean in DB2?
What is db2 plan table?
What is a bind card?
define clustering index.
Can we update view in db2?
How can you do the explain of a dynamic sql statement?