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 |
|
pgmr1998
Yak Posting Veteran
66 Posts |
Posted - 2008-04-11 : 10:46:18
|
| anybody know what sql statement can be used to pull duplicate records from an sql table. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-11 : 10:49:06
|
| Select col from tablegroup by colhaving count(col)>1EDIT : Fixed Syntax errorMadhivananFailing to plan is Planning to fail |
 |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-04-11 : 10:51:37
|
having count(col)>1 Em |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-11 : 10:53:58
|
quote: Originally posted by elancaster having count(col)>1 Em
Yes it is. I eidted itThanks MadhivananFailing to plan is Planning to fail |
 |
|
|
pgmr1998
Yak Posting Veteran
66 Posts |
Posted - 2008-04-11 : 11:37:54
|
| what is the difference between count(col) and count(*) |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-11 : 12:14:39
|
| count(col) looks for the number of occurances of col values while count(*) looks for number of occurances of all the columns in the table. they can be different when col contains many NULL values. count(*) will the total number of rows in the table while count(col) will give total number of non null values in col column. |
 |
|
|
|
|
|