Answer the question
In order to leave comments, you need to log in
Wrong database query?
Can anyone tell me what is the query error?
SELECT distinct zzz_1a.tip, zzz_1b.tip, zzz_tip_1a.id_tip, zzz_tip_1b.id_tip, zzz_1a.nomer_kvart, zzz_1b.nomer_kvart
FROM zzz_1a,zzz_1b,zzz_tip_1a, zzz_tip_1b
where ((zzz_1a.tip = zzz_tip_1a.id_tip) AND (zzz_tip_1a.kol_komnat=1)) OR ((zzz_1b.tip=zzz_tip_1b.id_tip) AND (zzz_tip_1b.kol_komnat=1))
Answer the question
In order to leave comments, you need to log in
Don't try to get the whole result at once.
Join zzz_1a and zzz_tip_1a. If the result is correct, then by analogy, do for type b, and then combine the results through UNION.
If wrong, look for the error. In general, decompose into components and simplify.
I tried to join, but I got confused and it turned out worse ..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question