On Saturday 22 April 2006 11:01, Jon Foster wrote:
> Using TMySQL40Connection I tried to use the following query:
>
> SQLQuery1.sql.text:='SELECT organizations.name as org,
> tests.name as test '+
> 'FROM tests INNER JOIN organizations '+
> 'ON tests.organization=organizations.id '+
> 'WHERE result<>''PASS'' '+
> 'ORDER BY tests.name';
>
> When I try "open" the query I received an error indicating that I had an
> error "near INNER JOIN ...". If I paste the query into the MySQL client
> it works. I also removed the word "inner" and tried it but received the
> same message except that it pointed to "join" instead of "inner".
> Rewriting the query like below it worked:
>
> SQLQuery1.sql.text:='SELECT organizations.name as org,
> tests.name as test '+
> 'FROM tests, organizations '+
> 'WHERE tests.organization=organizations.id AND
> result<>''PASS'' '+
> 'ORDER BY tests.name';
>
> Is there some filtering of the SQL that might be corrupting my query?
Try using
sqlquery1.TEXT:='SELECT organizations.name as org,
tests.name as test FROM tests, organizations WHERE
tests.organization=organizations.id AND result<>' + Quotedstr('PASS') +
'ORDER BY tests.name';
Is 'result' in only one of the tables?
John
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives