mardi 10 février 2015

SQL Express IF Statement

I just want to ask what's the proper way to use IF statement in SQL Express (2014). I have this code but i no luck it is not working.



select field1,
field2,
field3,
field4,
if(field5='value1',field5,
if(field5='value2',field5,
if(field5='value3',field5,
if(field5='value4',field5,field6)))) from table1


Any help will be grately appreciated. Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire