SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gagani
Yak Posting Veteran

87 Posts

Posted - 05/24/2012 :  15:26:32  Show Profile  Reply with Quote
orderid name
100 A
100 B
100 C
101 D
101 E
102 F

I want the list of orderids which has repeated more
than twice.
the output of above should be
100

bitsmed
Posting Yak Master

Denmark
107 Posts

Posted - 05/24/2012 :  15:32:13  Show Profile  Reply with Quote

select orderid
  from table
 group by orderid
 having count(*)>2

Edited by - bitsmed on 05/24/2012 15:32:52
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000