-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: how to transfer sql to hsql !
PostPosted: Thu Mar 11, 2004 8:16 am 
Newbie

Joined: Wed Mar 10, 2004 11:46 pm
Posts: 7
Location: china
This is the sql.
Code:
select p0.id as id from _hm_person p0 where (p0.id not in(select p2.person from _hm_organization_person_link p2 , _hm_organization o1 where o1.id=p2.organization))

I have tried this.
Code:
select person from Person as person , Organization as org where person  not in elements(org.persons)

But I get unexpected results ...
Code:
select p0.id as id from _hm_person p0  , _hm_organization o1 where (p0.id not in(select p2.person from _hm_organization_person_link p2 where o1.id=p2.organization))

", _hm_organization o1" is moved to the front.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 2:27 am 
Newbie

Joined: Wed Mar 10, 2004 11:46 pm
Posts: 7
Location: china


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 2:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is expected. Use subselect for that I guess

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 9:35 pm 
Newbie

Joined: Wed Mar 10, 2004 11:46 pm
Posts: 7
Location: china
Code:
select person from Person as person where person not in (select elements(org.persons) from Organization as org)

Thanks emmanuel! That solved this problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.