如何在HQL中执行外部联接/如何在HQL中使用外部联接查询

时间:2014-11-12 08:28:39

标签: sql hql outer-join

这是SQL请在HQL中转换

SELECT * 
   FROM calendar_table
 LEFT OUTER JOIN fitness_parameter 
   ON calDate=RecordDate
WHERE  calDate BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE() 
ORDER BY calDate DESC;

1 个答案:

答案 0 :(得分:1)

(select * from calendar_table
WHERE calDate BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()
) r left outer join fitness_parameter s on (r.calDate=s.RecordDate) ORDER BY r.calDate DESC;