SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Oct 2006
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select from where (id, name) in ((id1, name1),...(idN, nameN))

    select from where (id, name) in ((id1, name1),...(idN, nameN)). Would this kind of SQL possible?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    yes, in standard sql, but not in mysql

    in mysql you have to say it this way:
    Code:
    WHERE id = id1 AND name = name1
       OR id = id2 AND name = name2
       OR ...
       OR id = idN AND name = nameN
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used something like this:

    WHERE ID_RELATION In ('01','02','03','06') AND UBICA In (1,2,3)

    I think you can use in this form.


Bookmarks

Posting Permissions

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