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 / suleman

Try this one


select ACC.NO,ACC.NAME
FROM ACCOUNT
group by ACC.NO
HAVING COUNT(*) > 1

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to retrieve rows from a db2 table in embedded sql?

730


What is commit in db2?

596


Highlight all the advantages that are attached to a package.

629


How do I delete a table in db2?

651


What is the difference between plan and package in db2?

577






What is the purpose of using commit?

618


What is db2 catalog database?

582


What does sqlcabc has?

633


What is a dbrm in db2?

576


How to create backup table in db2?

644


What is the result of open cursor statement?

638


Cursors can be declared in both working-storage & procedure division, agreed. But is there any difference? If could you please suggest what is the difference

751


What is the difference between spufi and qmf?

639


Mention a credible reason why select* is never given preference in an sql program that has been embedded.

719


What is an instance in db2?

563