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 / 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 |
where will u check for sqlcode ?
How many databases are there?
What is a host variable?
Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.
What is a DB2 bind?
What statistic will tell the DBA how must space can be reclaimed from dropped table spaces on the next reorg run?
When do you specify the isolation level? How?
DB2: A calls B once sucessfull and second time when it calls says curson is open why is it so?
What is the purpose of coding FETCH in a SQL SELECT query? Explain with an example in Detail?
by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?
Where is the access path logic created by the DB2 Optimizer stored?
How is the value function used?