jeudi 22 janvier 2015

how to use if in a select statement

my goal is to the following:


select name, address, day,hoursworked { if hoursworked>8 then (hoursworked -8) as OT else '' } from testtable


how can i accomplish that. i have tried to use case, but i keep getting error regarding can't convert varchar to an INT. i need that in a select statement.


Aucun commentaire:

Enregistrer un commentaire