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 |
|
purushotham216
Starting Member
14 Posts |
Posted - 2010-09-18 : 03:03:48
|
| hi to all .thanks in advance I want to get matched recods(if name in both locations ) from table Table is like this Name Location a loc1b loc1a loc2 o/p (name a in both locations loc1 and loc2)a loc1a loc2 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-09-18 : 09:09:29
|
| [code]SELECT Name, Location FROM(SELECT COUNT(1) OVER (PARTITION BY Name) AS Cnt,Name, Location FROM Table)tWHERE Cnt >1[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|