Filter records in "from clause" before "where clause"

Posts   
 
    
Posts: 8
Joined: 15-Mar-2007
# Posted on: 07-Apr-2007 15:37:47   

How can I create this filter?confused

Select * from (select * from Table1 where Field1=1) As FilterdTable Right Outer Join Table2 On Table1.Field3=Table2.Field3

Notice that the filter of table1 can not be placed in where clause. because the right join imposes some null values to result set and filtering the left table after join (in where clause) would eliminate some vital records.

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 08-Apr-2007 18:54:11   

does this sql produce the same results

Select * from Table1 Right Outer Join Table2 On Table1.Field3=Table2.Field3 and Table1.Field1=1

if so then use the _Relation.CustomFilter _property to add new PredicateExpression(Table1Entity.Field1 == 1);

Posts: 8
Joined: 15-Mar-2007
# Posted on: 09-Apr-2007 12:52:31   

It solves my problem,Thanks.