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 |
|
lols
Posting Yak Master
174 Posts |
Posted - 2008-02-09 : 02:45:19
|
| What's wrong with my codeset rowcount 1select nullwhile @@rowcount > 0delete t1from Products as t1where t1.ProductCode = (select top 1 t2.ProductCode from Products AS t2 group by t2.ProductCode) as x on x.ProductCode = t1.ProductCodeset rowcount 0I get Incorrect syntax near the keyword 'as'. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-09 : 03:05:22
|
quote: Originally posted by lols What's wrong with my codeset rowcount 1select nullwhile @@rowcount > 0delete t1from Products as t1where t1.ProductCode = (select top 1 t2.ProductCode AS t2 from Products group by t2.ProductCode) as x on x.ProductCode = t1.ProductCodeset rowcount 0I get Incorrect syntax near the keyword 'as'.
shift AS alias before from |
 |
|
|
lols
Posting Yak Master
174 Posts |
Posted - 2008-02-09 : 03:08:57
|
| Hi,Thanks for replying but still the same errorset rowcount 1select nullwhile @@rowcount > 0delete t1from Products as t1where t1.ProductCode = (select top 1 t2.ProductCode AS t2 from Products group by t2.ProductCode) as x on x.ProductCode = t1.ProductCodeset rowcount 0the error is on "as x on x.ProductCode" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-09 : 03:14:24
|
chage like this:-set rowcount 1select nullwhile @@rowcount > 0delete t1from Products as t1inner join (select top 1 t2.ProductCode AS t2 from Products group by t2.ProductCode) as x on x.ProductCode = t1.ProductCodeset rowcount 0 |
 |
|
|
lols
Posting Yak Master
174 Posts |
Posted - 2008-02-09 : 03:50:23
|
| thanks |
 |
|
|
|
|
|