MySQL Forums
Forum List  »  Newbie

Re: #1064 - You have an error in your SQL syntax.
Posted by: jjgordon
Date: August 30, 2004 05:48PM

Your tables have columns of the same exact names. Your select statement needs to specify an AS keyword to assign an alternative name to the column(s). For example:

SELECT Accounts.customer_id AS AccountCustomerID, Customers.customer_id AS CustomerID
FROM Accounts, Customers
Where Accounts.customer_id=Customers.customer_id
AND Customers.customer_id=#session.custid#
AND Accounts.account_id=#session.accid#

Options: ReplyQuote

Written By
Re: #1064 - You have an error in your SQL syntax.
August 30, 2004 05:48PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.