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
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
For a db2 column that is being defined as decimal (11, 2), discuss the cobol picture clause.
What is rct?
When reorg is used?
What is the maximum number of columns in a db2 table?
What are the different types of base tables?
What is db2 optimizer?
How many databases can be created inside an instance in db2 ?
What is ibm db2 used for?
What is bind package and plan in db2?
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
what are bind concepts in db2 cobol?
Who uses db2?
can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well
What are the full forms of spufi and dclgen and why are they used?