4 messages in com.mysql.lists.mysqlre: sub selects
FromSent OnAttachments
Daniel Rossi29 Apr 2003 20:13 
Kevin Fries30 Apr 2003 09:08 
electroteque30 Apr 2003 15:24 
Victoria Reznichenko01 May 2003 04:44 
Subject:re: sub selects
From:Victoria Reznichenko (vict@ensita.net)
Date:05/01/2003 04:44:38 AM
List:com.mysql.lists.mysql

On Wednesday 30 April 2003 06:13, daniel dot rossi at sbs dot com dot au wrote:

hi am am having a few problems with my sub selects , i have never tried this before but assuming i now got myself a 4.1 server @ work i may aswell try it

SELECT * from shotlist where locations IN (select locationID,location from locations)

It's incorrect query at all, because you have 2 columns in the second select.

here is the query

basically i have a field in shotlist called locations , i have a table called locations and a field in their called location , heh

anyway the fields in locations would look 1,2,3 for the corresponding multiple location id's

here is what mysql returns

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT locationID FROM locations ) LIMIT 0, 30' at line 1

Could you provide complete query, not only error message?