84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
有一张用户教育经历的数据表,就是类似那种小学6年,初中3年,高中3年的教育经历。表中有字段useId, 外键关联到user用户信息表beginTime, 教育经历开始时间endTime, 教育经历结束时间school, 接受教育的学校现在已知张三的useId=100,我想得到张三最近的接受教育的学校,也就是查询出在userId=100的条件下beginTime最靠近今天的数据,hql语句该如何写?
光阴似箭催人老,日月如移越少年。
SELECT `school` FROM `table` WHERE userId = 100 AND beginTime = max(beginTime)
光阴似箭催人老,日月如移越少年。