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
How to create backup table in db2?
What does runstats do in db2?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
What is db2 bind?
What is host variable?
Explain packages.
Where can you declare a cursor in a cobol-db2 program?
Explain the contents that are a part of dclgen.
What is cobol db2?
What is runstats utility in db2?
What is the difference between dbm cfg and db cfg file in db2 ?
How does coalesce work?
How can you count the number of rows from a table tab?
Why do we need reorg in db2?
What is cloudant database?