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 |
How will fetch last 5 rows from table in db2
What are the contents of a dclmgen?
What are data types?
In BIND, isolation level parameter specifies the duration of page lock and ACQUIRE, RELEASE also do almost the same thing. What is the exact difference between the two? Do they work in conjunction while executing SQL queries and obtaining locks?
What is cursor with hold option in db2?
What is the use of db2?
How to execute stored procedure in db2 command editor?
In terms of DB2 indexing, what is the root page?
How do you leave the cursor open after issuing a COMMIT? (for DB2 2.3 or above only)
What is temporal table in db2?
Following a db2 update statement, what is the quickest way to compute the total number of updated rows?
What is the usage of open cursor command?