Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8400959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:41:04+00:00 2026-06-09T21:41:04+00:00

I need to convert this SQL query to HQL select * from ( select

  • 0

I need to convert this SQL query to HQL

select
        * 
    from
        ( select
            routemaste0_.ROUTE_ID as col_0_0_,
            routemaste0_.ROUTE_CODE as col_1_0_,
            routemaste0_.START_PLACE_ID as col_2_0_,
            routemaste0_.END_PLACE_ID as col_3_0_,
            routemaste0_.IS_ACTIVE as col_4_0_,
            routemaste0_.LINKED_ROUTE as col_5_0_
        from
            OPRS_ROUTE_MASTER routemaste0_
            inner join OPRS_ROUTE_HALTS routehalts0_
                 on routemaste0_.route_id = routehalts0_.route_id
        where routehalts0_.PLACE_ID = '51'
        order by
            routemaste0_.ROUTE_ID ASC  )

I tried this way

SELECT    rm.id , 
          rm.routeCode , 
          rm.startPlaceId , 
          rm.endPlaceId , 
          rm.active , 
          rm.linkedRoute 
FROM      RouteMaster rm  
          INNER JOIN  rm.routeHalts AS rh 
WHERE     rm.id = rh.routeId  
          AND  rh.placeId = :PlaceId  
ORDER BY  rm.id  ASC

but not getting the expected result. My concern is i need the inner join on condition to execute.

Can some one help me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:41:06+00:00Added an answer on June 9, 2026 at 9:41 pm

    I think that the reason of problem can be that route_id is not a primary key in any of tables. Thats why I recommend you to try Theta style join in this case:

    SELECT  rm.id , rm.routeCode , rm.startPlaceId , rm.endPlaceId , rm.active, rm.linkedRoute 
    FROM RouteMaster rm, RouteHalts rh
    WHERE rm.routeId = rh.routeId AND rh.placeId = :PlaceId  
    ORDER BY  rm.id  A
    

    And in your variant of HQL query you don’t need rm.id = rh.routeId part in where condition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please i need someone to help convert this query entity(c#) form. select * from
i need to convert this HQL: FROM Appointment a WHERE (a.group==null OR :user MEMBER
Below is my SQL query used in SSRS report SELECT Claimname,CONVERT(VARCHAR,ClaimResponsedate,101) FROM Claim WHERE
I need to convert this SQL query to nhibernate declare @i int set @i=2
i need Sql query Convert Table1 to Table2 select Count(Page) as VisitingCount,CONVERT(VARCHAR(5),Date, 108) as
I'm having a hard time with this SQL Query. I need to convert this
Need to convert this sql query to nhibernate criterion language... How can I do
I need to convert this SQL Query to LINQ Query, also I need to
I am new to HQL. This is a mysql Query. I need to convert
I have a SQL query like this (pseudo code) Select ID, TEXT, 1, 2,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.