>Hovewer, for do this you have to build a complete work table, and filter it.
>REMEMBER THIS:
>you can transform the "not in" or "not exists" condition in an INNER JOIN,
>into a LEFT JOIN with a WHERE IS NULL condition.
>
>select
>...
>from trans T INNER join Trans_Employees_Queues Q on T.cTrans_pk = Q.cTrans_fk
>INNER JOIN ....
>LEFT JOIN Employee_Queue_Schedules S ON S.FK=
>WHERE .... and S.FK IS NULL
>
>
Hi Fabio,
I guess I'm being slow this long weekend <g> I just realised that your idea will work for me and I do not really need a special flag (though my manager already agreed to add it). My only concern is that adding this condition may slow down the process. I need somehow to apply this filter after I executed the first main filter. In other words, my select will look like:
select myFields from Trans inner join Trans_Employees_Queues ...
left join Trans_Employees_Queues TEQ on left join employee_queue_schedules EQS...
where myOriginalWhereCriteria and EQS.FK is NULL
If it's not broken, fix it until it is.
My Blog