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 |
|
devinev
Starting Member
16 Posts |
Posted - 2004-12-08 : 11:54:02
|
| I am trying to count the number of duplicates in a table for a statistical report. I have the following transact SQL statement that is giving me an error on the equal sign in line 4:Declare @DupeCnt int Select StartDTG, Van into #tempcnt from MergeWHERE Exists (Select StartDTG, Van from Merge a where Merge.StartDTG=a.StartDTG & Merge.Van='01'group by StartDTG, Van having count(*)>1)Select @EmitDupeCnt=(Select count(*) from #tempcnt) Update Merge_Stats set Dupe_Cnt=@DupeCnt where @DupeCnt>0Can anybody help?Thanks,VeeDee |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-12-08 : 12:03:47
|
change & to or AND...Go with the flow & have fun! Else fight the flow |
 |
|
|
devinev
Starting Member
16 Posts |
Posted - 2004-12-08 : 12:09:07
|
| Thanks, that was it.VeeDee |
 |
|
|
|
|
|