select distinct(empid),distinct(dept),name
from EMP
will the above query work?
Answer Posted / 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 View All Answers
What is db2 plan table?
What do you mean by between and in? Is between inclusive of specified range values?
How can tablespace be moved to another dasd volume that is allocated for that tablespace?
Define check constraint.
What is db2 and what is the use of db2 optimizer?
What is the maximum size of a char data type in db2?
have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.
What is sqlca?
What is the maximum size of varchar data type in db2?
Which command is used to connect to a database in DB2 ? Give the Syntax.
What kind of database is db2?
Explain in detail about buffer manager and its functionalities?
what is db2 restart?
What is ibm db2 used for?
Explain about rct in db2?