你能检查一下这个sql查询有什么问题吗
SELECT DISTINCT
A.a
A.b
FROM tableAA AS A
INNER JOIN(tableBB AS B)
ON(A.a= B.a)
INNER JOIN(tableCC AS C)
ON(A.a = C.a)
INNER JOIN(tableDD AS D)
ON(A.a = D.a)
WHERE
B.c = '$selectedtype' AND
B.d NOT LIKE '%$selection%' AND
C.e='$selction111'
OR
D.c = '$selectedtype' AND
A.d NOT LIKE '%$selection%' AND
C.e='$selction111'
我对 OR 条件有疑虑,我在这里想要“where”和“OR”之间的条件为真或低于“OR”的条件为真。
书写方式是否正确?还是有其他写法?