Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

converting sql query to hql

 
Steven Adams
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'd like to convert the following query to hql...
Anyone knows?
It's pretty complicated!
Thanks,
Steve

SELECT DISTINCT
a.*
, NVL(b.COL1, 0) AS WORKING
, NVL(c.COL2, 0) AS RECRUITED
, NVL(d.COL3, 0) AS FIRED
FROM PM_CATEGORY a
LEFT OUTER JOIN (SELECT CATEGORY_ID,
COUNT(*) OVER (PARTITION BY CATEGORY_ID, TRE_NODE_ID3) AS COL1
FROM EM_EMPL_FILE
WHERE TRE_NODE_ID3 = 1
) b ON a.ID = b.CATEGORY_ID
ORDER BY 1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic