如何构建DQL查询

时间:2013-05-23 12:12:04

标签: mysql doctrine-orm left-join

我的查询

SELECT * FROM Reservations_Interval LEFT JOIN Reservations_Booking 
ON 
Reservations_Interval.id = Reservations_Booking.interval_id
WHERE 
service_id = 8

return Doctrine_Query::create()  
                ->select('RI.*, RB.*')
                ->from('Reservations_Interval  r')
                ->leftJoin('r.Reservations_Booking rp')
                ->where('date >= ? AND date <= ? AND service_id = ? ',  array('2013-05-27', '2013-05-29',9))
                ->execute(); 

我收到错误

错误

Unknown relation alias Reservations_Booking

出了什么问题?

0 个答案:

没有答案