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 |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-10-04 : 06:23:19
|
| i want to get records which are appearing more than once with the following 4 field combination from @tempfinalyearnum, monnum, qtrnum, projidselect yearnum, monnum, qtrnum, progid, projid from @tempfinalthank you very much for the helpful info. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-04 : 06:40:19
|
| [code]select yearnum, monnum, qtrnum, progid, projid from(select count(1) over (partition by yearnum, monnum, qtrnum, progid) as cnt,yearnum, monnum, qtrnum, progid, projid from @tempfinal)twhere cnt>1[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|