-->
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.  [ 1 post ] 
Author Message
 Post subject: Exclusions using Criteria and left joins
PostPosted: Fri Mar 16, 2007 2:15 pm 
Newbie

Joined: Fri Mar 16, 2007 12:25 pm
Posts: 1
Hibernate version: 3.2.1.ga

Name and version of the database you are using: Informix 10


Hi!

I've been looking for a solution in FAQs and previous posts about this problem. I will try to simplify it:

I have 2 tables, orders and invoices for example


ORDERS
order_id
order_desc
...

INVOICE
invoice_id
order_key
...

What I need to do is to get a collection of orders which has not an invoice associated, I mean something like select * from ORDERS where order_id not in (select order_key from INVOICE)

I want to avoid to use subqueries so what I´d like to do with criteria is this:

select * from ORDERS a left outer join INVOICE b on a.order_id=b.order_key and b.invoice_id is NULL

any ideas?

Thanks in advance!!


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

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.