Hi!
I'm trying to write a query in Hibernate using native SQL that contains a subselect..the simplified version of the query looks something like:
Code:
select u.first_name, u.last_name, u.username,
(select balance from account_info
where account_fk = u.account_pk
and (date_start <= '2009-2-1' or date_end > '2009-2-1') as balance
from user u
order by username
when I run this query using
Code:
Query query = session.createSQLQuery(query);
this.setResults(query.list());
I get the following error: Column '' not found.
Can anyone tell me why hibernate does not like this?
Thanks!