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


Please Help Members By Posting Answers For Below Questions

What is the difference between spufi and qmf?

641


What is a buffer in memory?

602


Explain the function of data manager.

635


What is view db2?

626


What is cloudant database?

647






What is the latest version of ibm db2?

744


How to find schema of a table in db2?

574


What is a page in db2?

614


What is buffer pool and list some of them?

630


What is the syntax for creating a table in the db2 database?

628


What is null indicator in cobol db2?

587


How do I add a column in db2?

596


How do you pull up a query which was previously saved in qmf?

678


What is the syntax for FETCH in DB2 ?

677


Is the primary key a clustered index?

615