Sunday, June 7, 2009

Query for Count Double Records in a Table

Declare @c_no int
Set @c_no=1
select id1,count(id1) as cnt from tab1
group by id1
having count(id1)>@C_No
Note: Result will come this way->
id1 cnt
101 2
103 2

No comments:

Post a Comment