Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Help Request

Status
Not open for further replies.

tyrisguy

MIS
Apr 21, 2004
2
US
The webhoster I'm currently using runs MySQL 3.5.x, which does not seem to support subqueries. Can anyone help me write the following query without subqueries? Much appreciated.

SELECT Table1.*, Table2.*, Table3.*
FROM Table1 INNER JOIN (Table2 LEFT JOIN Table3 ON Table2.Field = Table3.Field) ON Table1.Field= Table2.Field;

Thanks!
Evan
 
I don't see any subquery in your post.
You may try this:
SELECT Table1.*, Table2.*, Table3.*
FROM Table1
INNER JOIN Table2 ON Table1.Field = Table2.Field
LEFT JOIN Table3 ON Table2.Field = Table3.Field


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

Thank you, PHV. I am very new to SQL and coding in general (except for HTML) and wanted to get some results early, before I can read & write this language effectively. Now that the beta of my app works, I can go back to the woodshed and learn the language.

I believe the bracketed section is a subquery. I did not write that query, but got it from MSAccess. I think the way is was written would work in newer versions of MySQL, but I'm currently stuck with an older build. However, since the syntax you provided contains exactly the same words as the one that did not work, just in slightly different order and without the brackets, it may be that I was simply dealing with differences between the way Access and MySQL like their SQL.

Evan
 
Be aware that MS-Access is far away from ANSI compliance ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top