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
Explain the function done by data manager?
How does a cursor work?
How can you count the number of rows from a table tab?
What is the physical storage length of the data types date, time, and timestamp?
What is ibm db2 used for?
List some fields from sqlca?
what are bind concepts in db2 cobol?
How connect db2 database to datastage?
How can the duplicate values be eliminated from db2 select?
What is a bind card?
I HAVE 500 ROW TO UPDATE I WOULD LIKE TO USE ROLLBACK ALONG WITH COMMIT.WHAT IS THE SYNTAX TO CODE COMMIT AND ROLLBACK FOR EVERY 100 ROWS.AND HOW THE CURSOR ROLLBACK TO THE LAST COMMITTING POINT.
Is it possible to create an Instance in DB2 using DB2 Control Center ?
Is db2 a programming language?
What is alias in db2?
What is dbrm?