TopLabs (Answers)
| Thumbnail | TopLab | Author | Date | Reward |
|---|---|---|---|---|
| -- begining of query that you need declare @count int declare @call_code int declare tmpcursor cursor for select call_code, count(*) from ##cah group by call_code having COUNT(*) > 1 open tmpcursor fetch next from tmpcursor into @call_code, @count while @@fetch_status = 0 begin set @count = @count - 1 set rowcount @count delete from ##cah where call_code = @call_code fetch next from tmpcursor into @call_code, @count end close tmpcursor deallocate tmpcursor go -- end of query | Frederic Luchting | 2002-07-16 | $13.53 |