• 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!