I have a little problem:
the sql:
SELECT *
FROM confc c
LEFT JOIN template t ON ( c . cname = 'template' AND c . cvalue = t . id )
WHERE ( c . foreignid = 1 AND foreignref = 1 ) OR ( c . foreignid = 2 AND foreignref = 2 )
the test data:
foreignid foreignref cname cvalue
1 1 template 1
1 2 template 2
1 3 template 17
1 1 maxlevels 17
2 2 template 1
the problem:
this doesn't select the maxlevels row. I want the c.cname = 'template' condition to be just used for the join, not for the rest of the query.
Is this even possible?