Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2011
    Posts
    3

    Question Unanswered: 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
    )

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    your table1 ids are strings? that's weird, most people use integers
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    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.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Aug 2011
    Posts
    3
    I think this is the wrong forum. How can I delete this thread and my account?

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if you're actually using mysql, this is the right forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •