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
What is scrollable cursor in db2?
What happens in bind step in a db2 program?
is it compulsory commitment control in journal?
How to find the number of rows in a db2 table?
What is the reason behind not using select * in embedded sql programs?
How to create db2 table in mainframe?
How is the value function used?
What are db2 tables?
What is db2 instance?
Explain the contention situations caused by locks?
How to execute stored procedures?
What is runstats db2?
What is the difference between cursor and select statement?
Is ibm db2 open source?
What is the difference between db2 and oracle?