view help

  • I have a view like below..

    select col1,col2.....col46 from dbo.RevPD R

    union

    select col1,col2.....col46 from dbo.BudgetPD B

    where EmpRange in ('SEC2','SEC5')

    and B.empno not in (select empno from emplookup.dbo.emplist where empstat=1)

    above view works fine but i am sure there should be a better way of doing where clause to improve the performance any thoughts?

    may be a join to emplookup table would work better, right?

  • You could try an outer join, or you could look at the EXCEPT operator. As ever, you'll want to to test each one against your own data to see which one performs the best (and gives the correct results, of course).

    John

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply