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

  • Home
  • SEARCH
  • 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 7849199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:26:58+00:00 2026-06-02T18:26:58+00:00

I am trying to write a sub query in this format listObj = session.createQuery(from

  • 0

I am trying to write a sub query in this format

listObj = session.createQuery("from TablePersistence where column1 not in (select column2 from TablePersistence)").list();

Note that I use a different column of the same table in the sub query.

But I get an exception when it is executed. The exception message is:

No data type for node: org.hibernate.hql.ast.tree.IdentNode 
\-[IDENT] IdentNode: 'column2' {originalText=column2}

I can provide the stack trace as well if needed.

But what I feel from looking at the stack trace is that, this is not the way to write a sub query, I am missing something.

Please tell me what is the problem with this query.

Thanks!!

  • 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-02T18:26:58+00:00Added an answer on June 2, 2026 at 6:26 pm

    You need to give table aliases. Then it will work

    from TablePersistence table1 where table1.column1 not in (select table2.column2 from TablePersistence table2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a sql query to the following (from this site http://sqlzoo.net/1b.htm
I am trying to write a simple correlated sub query that deletes all records
I am trying to write the following query on postgresql: select name, author_id, count(1),
Original Query I'm trying to rewrite: SELECT Table1.* FROM Table1 INNER JOIN Table2 ON
I am trying to write a procedure that will fire the same select query
I have a query like this: SELECT id, user_id FROM orders GROUP BY user_id
I am trying to select the sub-menu item from a Wordpress default sidebar menu,
i am trying to write an algorithm for finding a sub matrix in a
Trying to write a javascript bookmarklet to jump from a front end link into
I'm trying to write a Microsoft SQL Server 2005 query that counts a total

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.