Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


select distinct(empid),distinct(dept),name
from EMP


will the above query work?

Answers were Sorted based on User's Feedback



select distinct(empid),distinct(dept),name from EMP will the above query work?..

Answer / 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

select distinct(empid),distinct(dept),name from EMP will the above query work?..

Answer / chidambara subbu

No, It will not work. We can select DISTINCT values for
multiple columns however not all the columns will give
ditint value. For intance , see below table TABLE1
Name City
XXX Chennai
FFF HYD
XXX Blore
YYY Mumbai

1.SELECT DISTINCT NAME FROM TABLE1
Name
XXX
FFF
YYY
2. SELECT DISTINCT NAME,City FROM TABLE1
Name City
XXX Chennai
FFF HYD
XXX Blore
YYY Mumbai

See the result of second query. It has selected duplicate
entry 'XXX' in the Name column.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

Can a Db2 table data be retrived through JCL?

4 Answers  


what is rebinding ?

1 Answers   IBM,


Cursors can be declared in both working-storage & procedure division, agreed. But is there any difference? If could you please suggest what is the difference

0 Answers  


What is bind in db2?

0 Answers  


What is DYNSLT keyword? How do you perform selection using DYNSLT

1 Answers  


Mention the location where the output received from explain statement is stored.

0 Answers  


What is the result of open cursor statement?

0 Answers  


what is the role of the cursor in db2?

0 Answers  


Give the COBOL definition of a VARCHAR field.

2 Answers  


Where do you specify them?

0 Answers  


What does db2 blu stand for?

0 Answers  


What is view db2?

0 Answers  


Categories