Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 10, 2012 06:18 AM by Young Yang - MSFT
Member
49 Points
70 Posts
May 03, 2012 08:57 AM|LINK
Hi
i want to write an HQL query where i want to compair a field with two values
like select * from table1
where table1.id=2 or table1.id=5
i can fetch the record for single condition bt dont knw how to use it 2 condition
thnx in advance
258 Points
84 Posts
May 03, 2012 09:01 AM|LINK
select * from table1 where table1.id in(2,5) and table1.name = 'tony'
May 03, 2012 09:20 AM|LINK
Whatever u wrote is write but its in SQL
i want my answer in HQL ie Hibernate Query Language
All-Star
21111 Points
1817 Posts
Microsoft
May 10, 2012 06:18 AM|LINK
I have never used HQL before. But I suggest you can read this article, it introduece how to query with HQL.
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/queryhql.html
Hope this helpful Regards Young Yang
priya77
Member
49 Points
70 Posts
to write an HQL query with or condition
May 03, 2012 08:57 AM|LINK
Hi
i want to write an HQL query where i want to compair a field with two values
like select * from table1
where table1.id=2 or table1.id=5
i can fetch the record for single condition bt dont knw how to use it 2 condition
thnx in advance
ruipedromach...
Member
258 Points
84 Posts
Re: to write an HQL query with or condition
May 03, 2012 09:01 AM|LINK
select * from table1 where table1.id in(2,5) and table1.name = 'tony'priya77
Member
49 Points
70 Posts
Re: to write an HQL query with or condition
May 03, 2012 09:20 AM|LINK
Whatever u wrote is write but its in SQL
i want my answer in HQL ie Hibernate Query Language
Young Yang -...
All-Star
21111 Points
1817 Posts
Microsoft
Re: to write an HQL query with or condition
May 10, 2012 06:18 AM|LINK
Hi
I have never used HQL before. But I suggest you can read this article, it introduece how to query with HQL.
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/queryhql.html
Hope this helpful
Regards
Young Yang
Feedback to us
Develop and promote your apps in Windows Store