2017-05-02 2 views
0

ich die folgende Abfrage habe:# 1054 - Unknown column 't2.id_pro' in 'where clause'

SELECT 
    t1.name as tipo, t1.id as id_tracker, 
    t2.name as nombre_pro, t2.id as id_pro, 
    t3.project_id as pro_tra_id, t3.tracker_id as id_pro_tra_id2 
FROM trackers t1, projects t2, projects_trackers t3 
WHERE t2.id_pro=t3.pro_tra_id and 
    t1.id_tracker=t3.id_pro_tra_id2 and 
    t3.pro_tra_id=1 

Aber das gleiche wirft mir die folgenden Fehler:

#1054 - Unknown column 't2.id_pro' in 'where clause'

I don‘ t verstehe wirklich, dass es passieren kann, wenn jemand mir helfen könnte, würde ich es schätzen!

+0

Bitte senden Fehler Ausgabe –

+0

formatieren Sie die Frage –

Antwort

0

Versuchen Sie folgendes:

SELECT 
t1.name as tipo, t1.id as id_tracker, 
t2.name as nombre_pro, t2.id as id_pro, 
t3.project_id as pro_tra_id, t3.tracker_id as id_pro_tra_id2 
FROM 
trackers t1, projects t2, projects_trackers t3 
WHERE t2.id = t3.project_id 
AND t1.id = t3.tracker_id 
AND t3.project_id=1 

Wenn Sie SELECT t1.name as tipo Sie entweder tipo oder t1.name aber nichtt1.tipo verwenden können. Außerdem glaube ich nicht, dass Sie die Aliase in der WHERE-Klausel verwenden können.

Verwandte Themen