Avatar of statin1
statin1

asked on 

Hibernate And Sub Query

Hi, I need to do the following query in hibernate. What is the best way to do this? We have a theater object mapped to Theater.hbml.xml.

SELECT
*
FROM
  (
  SELECT *
     
     -- AS
  --exactdistance
   FROM theater T
   WHERE dma = '501'
   ORDER BY 3959 *ACOS((SIN(40.7527 / 57.3) *SIN(latitude / 57.3)) +(COS(40.7527 / 57.3) *COS(latitude / 57.3) *COS((-73.66 -longitude) / 57.3))) ASC
   )
WHERE rownum <= 10;
Oracle Database

Avatar of undefined
Last Comment
DrSQL - Scott Anderson

8/22/2022 - Mon