Key Williams

Key Williams

  • NA
  • 2
  • 1.8k

New to sql. Need help with if formula

Aug 28 2014 12:38 PM
Need help

Below is my query
I would like the 99999 to generate in the data when any of the these numbers are included (10114,10135,10043). But if there are any other numbers use 99998.

 select chg.location, aa.*
from

(select * from TABLE
where location=10135
)aa, TABLE chg

where if (aa.location=(10135) then
        (select * from TABLE
        where location=99999)   else
       
        (select * from TABLE
        where location=99998)
        )


Answers (1)