Filter Usage

Posts   
 
    
lotek
User
Posts: 56
Joined: 14-Sep-2005
# Posted on: 09-Aug-2008 02:37:18   

How would i write something like:

select * from orders as orders1 where orderType = "type1" and orderId not in (select orders2.orderId from orders as orders2 where orders2.orderType = "type2")

Thanks, Matt

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 09-Aug-2008 06:02:23   

You should use **FieldCompareSetPredicate **object to create your NOT IN predicate simple_smile Use the overload that receives a bool negate parameter and set it to false. This will result in a NOT IN cluase: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=8819&StartAtMessage=0&#48750

Please let us know if you need further help on this.

David Elizondo | LLBLGen Support Team
lotek
User
Posts: 56
Joined: 14-Sep-2005
# Posted on: 11-Aug-2008 16:55:53   

Sorry, i forgot about the key part:

select * from orders as orders1 where orderType = "type1" and orderId not in (select orders2.orderId from orders as orders2 where orders2.orderType = "type2" AND orders1.date <> orders2.date)

Is there some way to alias the tables in the FieldCompareSetPredicate?

Thanks, Matt

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Aug-2008 22:19:30   

Use an SetObjectAlias method property to set the alias to on the fields you're using to build your FieldCompareSetPredicate. Some examples:

http://llblgen.com/TinyForum/Messages.aspx?ThreadID=9690&StartAtMessage=0&#53850 http://llblgen.com/TinyForum/Messages.aspx?ThreadID=10208&StartAtMessage=0&#56825

David Elizondo | LLBLGen Support Team