Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
WJHamel
Aged Yak Warrior
651 Posts |
Posted - 2012-01-10 : 13:21:10
|
| I need to show all rows in a table where the same EVPNO occurs more than three times. right now, i have Select * from evp_coc order by evpno.But i only want to show those instances where the EVPNO is repeated more than three times.I know it's simple, but i'm mind numbed right now.thanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-01-10 : 13:23:55
|
| [code]select required columns...from(Select *,count(1) over (partition by evpno) as cnt from evp_coc )twhere Cnt >3order by evpno[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
WJHamel
Aged Yak Warrior
651 Posts |
Posted - 2012-01-10 : 13:24:56
|
| ok, so it wasn't as simple as i thought. Thanks! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-01-10 : 13:27:08
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|