• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL to HQL

 
Raymund Nickel
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have a problem transforming the following SQL-Statement into HQL:

SELECT * FROM table_1 AS A INNER JOIN
(SELECT B.fkC, max(B.date) maxDate FROM table_1 AS B GROUP BY B.fkC) AS tmp
ON A.fkAlarmPointId = 100
AND A.dateCreated = tmp.maxDate

I know how a "normal" INNER JOIN works, but not with a subquery.

Thank you,
Ray
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic