MySQL Error - Unknown column 'xyz' in 'on clause'
Posted by: Jack Hard
Date: April 08, 2013 11:00PM

I recently upgraded the MYSQL version from 4 to 5 and I get this error..

Error No : 1054 Error : Unknown column 'c.city' in 'on clause'

`SELECT b.expirydate, a.ben_changed, a.amlnotes, a.processdate, c.phone AS beneficiaryphone, cpstate.statename AS collectionpointstate, cpcity.cityname AS collectionpointcity, cp.agentname AS collectionpointname, cp.agentaddress AS collectionpointaddress, cp.agenttelephone AS collectionpointphoneno, b.postcode AS customerpostcode, co.countryname AS bencountryname, st.statename AS benstatename, ct.cityname AS bencityname, a.depositbankname AS depositbankname, b.address AS customeraddress, b.phone AS customerphone, a.releasedate, a.releasedby, a.collectiontype, b.mobile AS customermobile, c.mobile AS beneficiarymobile, a.releasemessage, a.releaseorder, a.amlnotes, bf.bankname, a.branchname, a.accountno, a.ordertime, h.agentname AS payingagentname, a.cashcommission, d.agentname AS officename, a.orderdate, a.orderid, a.orderamount, a.agentcommission, e.username AS orderby, g.currencycode AS fromcurrency, f.currencycode AS currency, a.exchangerate, a.benamount, b.surname AS customersurname, b.firstname AS customerfirstname, c.surname AS bensurname, c.firstname AS benfirstname, a.orderstatus, a.saleid, a.benid, a.contactid
FROM contact_master b, ben_master c, agent_master d, sales_master a
LEFT JOIN agent_master cp ON a.collectionofficeid = cp.agentid
LEFT JOIN city_master cpcity ON cp.city = cpcity.cityid
LEFT JOIN state_master cpstate ON cp.state = cpstate.stateid
LEFT JOIN currency_master f ON a.currency = f.currencyid
LEFT JOIN city_master ct ON c.city = ct.cityid
LEFT JOIN state_master st ON c.state = st.stateid
LEFT JOIN country_master co ON c.country = co.countryid
LEFT JOIN currency_master g ON a.fromcurrency = g.currencyid
LEFT JOIN user_master e ON a.orderby = e.userid
LEFT JOIN payingagent_master h ON a.payingagent = h.agentid
LEFT JOIN bank_master bf ON a.bankname = bf.bankid
WHERE a.contactid = b.contactid
AND a.benid = c.benid
AND a.officeid = d.agentid
AND a.contactid = '2'
AND orderdate & gt ; = '2013-04-09'
AND orderdate & lt ; = '2013-04-09'
AND a.orderby != 'onlinewebsite'
ORDER BY orderdate, ordertime ASC
LIMIT 0 , 30'

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL Error - Unknown column 'xyz' in 'on clause'
2163
April 08, 2013 11:00PM


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.