-->
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.  [ 5 posts ] 
Author Message
 Post subject: Frage zu Mengenoperationen in HSQL
PostPosted: Wed Nov 29, 2006 9:56 am 
Newbie

Joined: Wed Nov 29, 2006 9:48 am
Posts: 8
Hallo,

ich habe eine Frage zu Mengenoperationen in HSQL.

Ich möchte eine SQL-Anfrage der Form

Code:
SELECT * FROM table WHERE table_id NOT IN (SELECT ref_table_id FROM ref_table)


in HSQL modellieren. Kann mir jemand mit dem entsprechenden HSQL Syntax helfen?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 4:22 am 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Code:
select t from Teddibaer t where size(t.puppenwagen) = 0

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 5:25 am 
Newbie

Joined: Wed Nov 29, 2006 9:48 am
Posts: 8
@LaLiLuna:

Danke für die Antwort, ist aber in meinem Fall nicht das gleiche. Ich möchte überprüfen, ob der Teddibaer einen puppenwagen hat, der bestimmten Anforderungen genügt.

Vielleicht hätte ich schreiben sollen:

Code:
SELECT * FROM table WHERE table_id NOT IN (SELECT ref_table_id FROM ref_table WHERE ref_table_val='value')


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 6:09 am 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Code:
select t from Teddibaer t left join t.puppenwagen p where p.value = ?


oder
Code:
select t from Teddibaer t left join t.puppenwagen p where p.id not in (
select p.id from puppenwagen p where p.x=?)

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 6:12 am 
Newbie

Joined: Wed Nov 29, 2006 9:48 am
Posts: 8
cool, thx!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.