2010-06-11 7 views
1

Possible Duplicate:
Was: Not unique table :: Now: #1054 - Unknown column - can't understand why?# 1054 - Unknown column - requête SQL Problème

Après avoir résolu un problème précédent avec cette requête, je suis maintenant coincé à obtenir cette erreur:

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

Je ne peux pas undertstand pourquoi ... et la colonne existe par défi! Est-ce quelque chose à voir avec la section WHERE blah AND ... de la requête en bas?

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 

Toute aide serait appréciée!

Vive

+1

Vous avez maintenant posé cette question deux fois que vous avez posées dans cette question aussi http: // stackoverflow. com/questions/3021429/was-not-unique-table-maintenant-1054-unknown-column-cant-comprendre-pourquoi – codingbadger

Répondre

2
You should use `calendar_events`.`jobID` instead of `calendar_events.jobID`. 
1

INNER JOIN and , (comma) are semantically equivalent in the absence of a join condition: both produce a Cartesian product between the specified tables (that is, each and every row in the first table is joined to each and every row in the second table).

However, the precedence of the comma operator is less than of INNER JOIN, CROSS JOIN, LEFT JOIN, and so on. If you mix comma joins with the other join types when there is a join condition, an error of the form Unknown column 'col_name' in 'on clause' may occur. Information about dealing with this problem is given later in this section.

De: http://dev.mysql.com/doc/refman/5.0/en/join.html

Hope this helps