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 use of value function?

629


What does reorg do in db2?

578


Can you tell me how can you find out the # of rows updated after an update statement?

612


What are types of indexes?

593


How to execute stored procedure in db2 command editor?

532






What is the difference between oracle and db2?

587


What is package in cobol db2?

704


In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?

579


run jcl for cobol+db2 pgm?.. //jobcard //step001 exec pgm=ikjeft01 //systin dd * DSNSYSTEM(--------) RUN PROGRAM(MYPGMNAME) PLAN(-----), LIB(-------), PARMS(------) /* WHAT WILL U GIVE INSIDE THE BRACKETS... WHAT IS PLAN,PACKAGE,BIND?..PLAN N PACAKGES ARE GENERATED BY ?...

3792


What is db2 optimizer?

771


Is db2 a mainframe?

588


What is innodb buffer pool?

564


What is db2 purescale?

551


Why do we bind in db2?

631


What is the reason behind not using select * in embedded sql programs?

603