|
|
|
|
|
|
![]() |
#1 |
Are you sure this is the Sci-Fi Convention? It's full of nerds!
|
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!
__________________
Submissions Wanted! |
![]() |
![]() |
![]() |
#2 |
Me fail English? That's unpossible!
|
Why do you have SELECT in there?
Should be more like DELETE FROM `links` WHERE `url` LIKE '%domain%'; |
![]() |
![]() |
![]() |
#3 |
Are you sure this is the Sci-Fi Convention? It's full of nerds!
|
Yeah - tried that and was getting an error with that one too....so figured I needed a subquery.
__________________
Submissions Wanted! |
![]() |
![]() |
![]() |
#4 |
Certified Nice Person
|
Wouldn't the simplist solution be
delete from 'links' where 'url' = 'whatever'
__________________
Click here to purchase a bridge I'm selling. |
![]() |
![]() |
![]() |
#5 |
Are you sure this is the Sci-Fi Convention? It's full of nerds!
|
It would if it was just one url
![]()
__________________
Submissions Wanted! |
![]() |
![]() |
![]() |
#6 |
Operator! Give me the number for 911!
|
I would use this:
DELETE FROM links WHERE url LIKE '%domain%' |
![]() |
![]() |
![]() |
#7 |
Are you sure this is the Sci-Fi Convention? It's full of nerds!
|
I tried that before posting - no luck with it - which is why I tried using the subquery.
Does Sparky still frequent the board?
__________________
Submissions Wanted! |
![]() |
![]() |
![]() |
#8 |
Are you sure this is the Sci-Fi Convention? It's full of nerds!
|
I got it
![]()
__________________
Submissions Wanted! |
![]() |
![]() |
![]() |
#9 | |
Operator! Give me the number for 911!
|
Quote:
Glad you could find the solution. |
|
![]() |
![]() |
![]() |
|
|