Page 1 of 1

Three tables linked via JOIN

Posted: Thu Feb 05, 2015 12:04 pm
by Borkovec
Hey, when joining multiple tables in SQL JOIN, an error occurs.
syntax to use near '((FROM SeznamHW...
MySQL

Code: Select all

 put "SELECT * ((FROM SeznamHW JOIN Firmy ON Firmy.ID = SeznamHW.IDFirma) JOIN Pracoviste ON Pracoviste.ID = SeznamHW.ID-Pracoviste)" into tSQL
put revDataFromQuery(tab, cr, gConnectionID, tSQL) into tData 
Thanks for your help
Vojta.

Re: Three tables linked via JOIN

Posted: Thu Feb 05, 2015 1:12 pm
by SparkOut
Unable to test, and only a quick glance at the code, but perhaps move FROM outside the parentheses

Re: Three tables linked via JOIN

Posted: Thu Feb 05, 2015 1:24 pm
by Borkovec
Parentheses are good by a SQL command that works over PhP admin in mySQL.
Join two tables with a JOIN, where they are not needed parentheses, works well.
I have not found anywhere in the documentation LiveCode example of a more tables via SQL.
Does anyone know why it does not work?
Thank you ,Vojta.

Re: Three tables linked via JOIN

Posted: Thu Feb 05, 2015 7:47 pm
by phaworth
Remove all the parentheses. They mightbe needed in phpadmin but your SELECT statement is invalid when executed as is..