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 |
Can a unique index have more than one null value? If not, what error code is given if an attempt is made to insert more than one null value?
How connect db2 database to datastage?
What is a db2 cursor?
Why select is not preferred in embedded sql programs?
Suppose we have a query for update update table1 set col1 = 'val1' where col2=(select .... from ...) suppose the subquery does not return any record, what will happen to update?
What is the difference between TYPE 1 index & TYPE 2 index
What is difference between rollback and commit?
What is a Resource Control Table(RCT)? Describe its characteristics.
SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD CHAR, TOKEN KEY was expected
What is DYNSLT keyword? How do you perform selection using DYNSLT
what is commit & rollback? When and where is used while compiling a cobol-db2 program?
How to view db2 table structure?