Can we use group-by clause in sub-query? If 'yes'
means,Will it be executed successfully or else If 'no'
means why should we not using that method? Give me your
suggestion please....
Answer Posted / db2222
Yes, we can use the Group-by in the subquery.
-----EX----
SELECT DISTINCT(A.IDN), B.NAME,B.EFF_DATE, B.CNCRCY_TMSTMP
FROM
Table1 A,
Table2 B,
Table3 C
WHERE
A.IDN = C.IDN
AND C.IDN = B.ALIAS_IDN
AND A.IDN IN
(SELECT IDN
FROM Table4
GROUP BY CUSACC_IDN
HAVING COUNT(*) > 1
)
WITH UR;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Give the name of some fields form sqlca.
What's The Error Code For Unique Index Voilation?
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 schema in db2?
What is a collection in db2?
What happens in bind step in a db2 program?
What is runstats and reorg in db2?
what is db2 restart?
What is the difference between cursor stability and repeatable read isolation levels?
What is the difference between plan and package in db2?
Explain correlated sub-queries.
What is ibm db2 client?
On which levels locks can be applied?
Explain in detail about buffer manager and its functionalities?
How can we read records for specific member in CL? AND rpg?