A quick look makes me think this maps to sql x in (table | subquery)
construct.

In the absence of nulls, these can be easily replaced by joins.  With
nulls, the expression can give the Unknown truth value which can be tested
for.

I don't know about ejb-ql and nulls.

Some people like to use expressions like this even if joins are simpler and
equivalent.

select l.*
from 
  lineitems l
  join orders o on l.orderid = o.orderid
where
  l.stateid in (select tc.stateid from taxcalendar tc where o.orderdate
between tc.salestaxholidaystart and tc.salestaxholidayend)


retrieves all items ordered during some states sales tax holiday.  

If you have really long and really different access paths to the two sides
of the in expression this makes more sense.  It might also be useful if you
are doing aggregation to help get the right multiplicity of what you are
counting.

Hope this is helpful

david jencks



On 2001.08.17 13:26:29 -0400 Dain Sundstrom wrote:
> For thoes of you that have looked at EJB-QL,
> 
> Can you think of a logical query that uses the MEMBER OF opperator? I
> can't
> seem to think of any examples that are not completely contrived.  If you
> can,  how would you map it to SQL?  How about the same for the NOT MEMBER
> OF
> opperator?
> 
> The EJB-QL code is almost done. Just 4 or 5 dangling strings to tie up.
> 
> Thanks,
> 
> -dain
> 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
> 
> 

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to