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

What is db2 plan table?

711


Which component is responsible for processing sql statements and selecting access paths?

764


How do I delete a column in db2?

755


What is explain plan in db2?

674


Which component is responsible for db2 startup and shutdown?

712






How to create db2 table in mainframe?

736


What is cursor with hold option in db2?

707


How to find the number of rows in db2 tables?

698


Is db2 a mainframe database?

647


Define db2 and its databases?

708


How do I change the column size in db2?

709


Mention data types used in db2 ?

766


How to access db2 tables in mainframe?

696


What are the contents of a dclmgen?

713


Are views updateable?

732