我是新来的HQl
查询请帮助我。实际上我的SQL Query
有5个表,即COURSE
,SKILLSET
,TIMETABLE
, INTREST
,USER
select
(select count(*) from intrest) AS
NoAttends,course.NAME,course.TYPE,user.FIRSTNAME,user.LASTNAME,skill.COURSE_CONT,
skill.TEACH_EXP,tt.CLASS_DUR,tt.COURSE_DUR,tt.DATE_TIME from COURSE course
inner join SKILLSET skill on
skill.course_id=course.s_id
inner join USER user on
user.s_id=skill.user_id
inner join TIMETABLE tt on
tt.course_id=course.s_id
where course.name IN ('course')
ORDER BY course.name LIMIT 10;
请帮帮我?
答案 0 :(得分:1)
尝试使用下面的内容。 。 。 。
SELECT t1.col1, t2.col2, t3.col3
FROM Table1 t1 JOIN t1.someGroupMemebers t2
JOIN t2.someUser t3 WHERE t3.username = 'blah blah'
答案 1 :(得分:0)
使用JPA for Hibernate对于ex:
非常容易 entityManager.createQuery("select cd from CourseDetailsVO cd join cd.course.keywords k where k.keyword in (:courseName) and cd.startDate between (:sDate) and (:eDate)", CourseDetailsVO.class);
setParameter("courseName", searchVO.getName())..
...
EntityManager将进行处理..