If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Wildcard in DELETE IN

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-01-11, 12:08
softwareuser softwareuser is offline
Registered User
 
Join Date: Aug 2011
Posts: 3
Question Wildcard in DELETE IN

Is there a way to use wildcards in a DELETE IN statement? Here's what I had in mind, but it doesn't work.

DELETE FROM table1 WHERE id IN (
SELECT CONCAT(id,'/page/%') FROM table2
)
Reply With Quote
  #2 (permalink)  
Old 08-01-11, 12:27
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
your table1 ids are strings? that's weird, most people use integers
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 08-01-11, 12:32
softwareuser softwareuser is offline
Registered User
 
Join Date: Aug 2011
Posts: 3
It's just an example. I didn't see the need to copy my exact field names coz they're very long. The fact that I used a generic table name, table1, in the example should indicate that.
Reply With Quote
  #4 (permalink)  
Old 08-01-11, 13:08
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
yeah, of course -- i've participated in a sufficient number of threads here to have recognized a generic table name

but that wasn't the question i asked you

your table1 ids are strings? that's weird, most people use integers
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 08-01-11, 13:17
softwareuser softwareuser is offline
Registered User
 
Join Date: Aug 2011
Posts: 3
I think this is the wrong forum. How can I delete this thread and my account?
Reply With Quote
  #6 (permalink)  
Old 08-01-11, 13:21
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
if you're actually using mysql, this is the right forum
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On