Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do select in such query

Status
Not open for further replies.

snooper1

Programmer
Aug 7, 2003
1
NZ
I have query ....
select account_no from test where element_id > 4618 and element_id < 4627

this gives me account_no which are not reapeted and reapeted
but i want only that which is repeated (not distinct)

thanks
 
Hi,


Try this sql.

select account_no
from test
where element_id > 4618 and element_id < 4627
group by account_no
having count(*) > 1

All the best
Vijay

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top