I have RATE and BRANCH_CURRE table. I want to perform left join operation (joining branch to rate) in Doctrine Query Language (DQL). My SQL Query is:
SELECT r.id rid
,r.TIME rtime
,r.rate_candidate
,r.exchange_rate
,r.branch
,r.STATUS ratestatus
,bc.currency
,bc.scale bcscale
,bc.STATUS bcstatus
FROM rate r
LEFT JOIN branch_currency bc ON (
r.branch = bc.branch
AND (
r.from_currency = bc.currency
OR r.to_currency = bc.currency
)
)
WHERE r.STATUS = 1
AND bc.STATUS = 1;
To be more specific, I have two questions here
- How to select some specific columns from both the tables.
- How to give the multiple ON conditions while joining tables.
So Please show the DQL query using queryBuilder(). Thanx in advance!!!