Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    West Milford, New Jersey
    Posts
    3

    Unanswered: Does mySQL support IN ( SELECT ... FROM )?

    Does MySQL support the following syntax:

    SELECT * FROM table1 WHERE table1_id IN ( SELECT table2_id FROM table2)

    I tried someting like that in mysql and got syntax errors. What would be the correct syntax? I know in many cases I could use joins but just want to know.

    Thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    mysql does not support subselects until version x
    (where x is a number i don't know offhand -- and cannot
    check because mysql.com seems to be down just now)

    use a join

    rudy
    http://rudy.ca/

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    The following is a previous post in dbforums:

    click here
    Last edited by rnealejr; 06-26-02 at 14:14.

Posting Permissions

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