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 |
IK1972
56 Posts |
Posted - 2012-09-12 : 14:22:13
|
I have one table suppose #temp with column ID.If I have data like this then I should see 'Inside If'ID123IF (select count(*) from #temp) > 1print 'Inside If'elseprint 'Inside else'If I have data like thisID1223then I should see 'Inside else' basically I want to check base on Group ID.Thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-12 : 14:48:28
|
it should beIF (select count(*) from (select ID from #temp group by ID having count(*) > 1)t) > 1------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
IK1972
56 Posts |
Posted - 2012-09-12 : 14:53:09
|
Yes, Thanks |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-12 : 14:55:06
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|