Good all the time of the day gentlemen

//запрос //подставляем металл нужному id //запрос - полностью работает SELECT t1.id, t2.assoc as metal, FROM tovar t1 LEFT JOIN tovar_assoc t2 ON t2.position=t1.metal WHERE t2.num=9 //работает и это SELECT t1.id, t3.assoc as proba FROM tovar t1 LEFT JOIN tovar_assoc t3 ON t3.position=t1.proba WHERE t3.num=10 //не работает... SELECT t1.id, t2.assoc as metal, t3.assoc as proba FROM tovar t1 LEFT JOIN tovar_assoc t2 ON t2.position=t1.metal WHERE t2.num=9 LEFT JOIN tovar_assoc t3 ON t3.position=t1.proba WHERE t3.num=10 

Actually, can anyone tell me how to build a query with 2 LEFT_JOINs? (Both levtjoine go from the same table)

    1 answer 1

    try this

     ... LEFT JOIN tovar_assoc t2 ON t2.position=t1.metal AND t2.num=9 LEFT JOIN tovar_assoc t3 ON t3.position=t1.proba AND t3.num=10 
    • It is the most) Only by logic should have been WHERE, but it turned out AND - sergey