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 you return the number of records in table?
What is view db2?
Can we update view in db2?
select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?
Which one allows duplicate values Union or Union All ?
How does coalesce work?
What is a synonym? How is it used?
What technique is used to retrieve data from more than one table in a single SQL statement?
Is it possible to precompile if db2 goes down?
What is a Database Request Module(DBRM)?
5 rows are inserted to a DB2 Table. Next 3 of those are updated, then a rollback is issued. What would happen when the rollback is issued?
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....