• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please help How to Write Sub Query in Hibernate

 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me write the following sub query in hibernate.
i ran the following subquery in MYSQL it works perfect in MYSQL


select * from mst_bank, (select udate from util_rep where id = 1) A
where mban_date_upd >= udate


MstBank is the class for mst_bank table,
UtilRep is the class for util_rep table.


thanks

regards
 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think you need a subquery..

A query like below should do it for you.

Select mb, up.udate
from MST_BANK mb, UTIL_REP up
where mb.mban_date_upd >= up.udate and up.id = 1

 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works perfect!


thanks rahul...you are so kind
 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The pleasure is mine, Yudi..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic