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 |
|
DMarmolejos
Yak Posting Veteran
65 Posts |
Posted - 2008-10-29 : 11:53:15
|
| How can I display only the rows that are repeating?SELECT DocNum, BarCodeFROM Table1WHERE BarCode = BarCode * 1This is what I had, but doesnt work. Is there a way that I can just select all rows in BarCode where there is a repeat? Any help is appreciated, thanks. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-29 : 11:55:45
|
| [code]SELECT t1.DocNum, t1.BarCodeFROM Table1 t1JOIN (SELECT BarCodeFROM Table1GROUP BY BarCOdeHAVING COUNT(*) >1)t2ON t1.BarCode=t2.BarCode[/code] |
 |
|
|
DMarmolejos
Yak Posting Veteran
65 Posts |
Posted - 2008-10-29 : 15:32:57
|
| thanks alot bro! solved my problem |
 |
|
|
|
|
|