![]() |
SQL Statement help
I've been trying to delete some links from my database using the following statement:
DELETE FROM `links` WHERE (SELECT * FROM `links` WHERE `url` LIKE '%domain%') but get the following error: "Operand should contain 1 column(s)" Can anyone tell me where I'm going wrong? Thanks! |
Why do you have SELECT in there?
Should be more like DELETE FROM `links` WHERE `url` LIKE '%domain%'; |
Yeah - tried that and was getting an error with that one too....so figured I needed a subquery.
|
Wouldn't the simplist solution be
delete from 'links' where 'url' = 'whatever' |
It would if it was just one url :) unfortunately there are about 1500 from one domain that I need to delete - plus many more domains will pop up I'm sure that will need the same treatment.
|
I would use this:
DELETE FROM links WHERE url LIKE '%domain%' |
I tried that before posting - no luck with it - which is why I tried using the subquery.
Does Sparky still frequent the board? |
I got it :)
|
Quote:
Glad you could find the solution. |
All times are GMT -4. The time now is 11:28 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc