if suppose i am having an ACCOUNT table with 3 coloumns ACC.
NO,ACC. NAME,ACC. AMOUNT . If a unique index is also
defined on ACC.NO and ACC.NAME then write a query to
retrieve account holders records who have more than 1 ACC.

Answer Posted / mallikarjun

select distinct ACC.NO,
ACC. NAME,
ACC. AMOUNT

from account
where acc.name in
( select distinct acc.name
from account
group by acc.name
where count(acc.no) > 1)

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the role of data manager in the db2 database?

727


Following a db2 update statement, what is the quickest way to compute the total number of updated rows?

711


What is catalog database in db2?

749


On which levels locks can be applied?

751


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.

2849






Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....

1984


Explain what are the various isolation levels possible?

676


What parameters are used to control the free space in DB2?

726


What is the meaning concurrency in the db2 database?

735


What is a cursor in programming?

696


What is image copy in db2?

649


what are bind concepts in db2 cobol?

731


Is db2 a programming language?

693


Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?

7100


Mention the different locking levels that are available in db2.

730