SQL Sentences Not In

Posts   
 
    
lenino
User
Posts: 13
Joined: 27-Apr-2009
# Posted on: 14-May-2009 20:11:27   

Can I define the next SQL Statement query with entities, do you have some example:

SELECT TASK_CODE, DESCRIPTION FROM COURSE_TASK WHERE COURSE_CODE = 'CLENINO021' AND TASK_CODE NOT IN ( SELECT TASK_CODE FROM COURSE_PREREQ WHERE COURSE_CODE = 'TEST' AND COURSE_REQ = 'CLENINO021')

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 14-May-2009 22:07:10   

You certainly can. Take a look at FieldCompareSetPredicates.

Note that by default the FieldCompareSetPredicate will generate code of the form

WHERE x IN (SELECT y FROM Z)

to get a NOT IN there is a negate paramater that needs to be set to true.

Matt