Search code examples
mysqlmysql-error-1054

#1054 - Unknown column - SQL Query Problem


Possible Duplicate:
Was: Not unique table :: Now: #1054 - Unknown column - can't understand why?

After having solved a previous issue with this query, i'm now stuck with getting this error:

1054 - Unknown column 'calendar_events.jobID ' in 'on clause'

I can't undertstand why... and the column defiantly exists! Is it something to do with the WHERE blah AND ... section of the query at the bottom?

SELECT calendar_events.* , 
       calendar_users.doctorOrNurse, 
       calendar_users.passportName, 
       calendar_jobs.destination
  FROM `calendar_users` , `calendar_events`
INNER JOIN `calendar_jobs` ON `calendar_events.jobID` = `calendar_jobs.jobID`
     WHERE `start` >=0
       AND calendar_users.userID = calendar_events.userID

Any help would be appreciated!

Cheers


Solution

  • You should use `calendar_events`.`jobID` instead of `calendar_events.jobID`.