4 messages in com.mysql.lists.mysqlre: sub selects| From | Sent On | Attachments |
|---|---|---|
| Daniel Rossi | 29 Apr 2003 20:13 | |
| Kevin Fries | 30 Apr 2003 09:08 | |
| electroteque | 30 Apr 2003 15:24 | |
| Victoria Reznichenko | 01 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?
-- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ Vict...@ensita.net /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com




