Not unique table/alias - can't understand why!?

Posted by Andy Barlow on Stack Overflow See other posts from Stack Overflow or by Andy Barlow
Published on 2010-06-11T08:47:46Z Indexed on 2010/06/11 8:52 UTC
Read the original article Hit count: 198

Filed under:
|

Hi!

I'm trying to join some tables together in MySQL, but I seem to get an error saying: #1066 - Not unique table/alias: 'calendar_jobs'

I really want it to select everything from the cal_events, the 2 user bits and just the destination col from the jobs table, but become "null" if there arn't any job. A right join seemed to fit the bill but doesn't work! Can anyone help!?

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

Cheers!

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query