subselect doesnt work

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Rossi

    #1

    subselect doesnt work

    hi there, i am trying to remove values from a list menu if the join table d=
    oesnt have keys when a key is selected for instance:
    locations
    locationID

    locations_join
    locationID shotlistID

    SELECT SQL_NO_CACHE l.locationID , l.location FROM locations l LEFT JOIN lo=
    cations_join lj ON l.locationID =3D lj.locationID WHERE l.locationID NOT IN=
    (select locationID FROM locations_join WHERE shotlistID IN (5069)) ORDER B=
    Y l.location ASC

    so when shotlistID is selected all the keys from the locations_join joined =
    to the shotlistID would be remove from the locations list please help, i'm =
    trying to do this in one query saving from getting all the keys into an arr=
    ay then checking if the values arent in the array when generating the list.


    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=3...ie.nctu.edu.tw

Working...