Subject | case - when syntax |
---|---|
Author | Maurizio |
Post date | 2008-07-27T15:57:29Z |
hi ,
in a select statement i use :
sum(case m.dmtipo when 'NC' then D.dttotrig else 0 end) AS
"Valore 1 ",
sum(case m.dmtipo when 'FI' then D.dttotrig else 0 end) AS
"Valore 2 "
and it does what i want ,
just i don't know how to add an 'OR' clause : something like
...if dmtipo is 'FI' OR 'FD' sum D.dttotrig else 0 end) AS "Valore
2 " ...
thanks
Mauro
in a select statement i use :
sum(case m.dmtipo when 'NC' then D.dttotrig else 0 end) AS
"Valore 1 ",
sum(case m.dmtipo when 'FI' then D.dttotrig else 0 end) AS
"Valore 2 "
and it does what i want ,
just i don't know how to add an 'OR' clause : something like
...if dmtipo is 'FI' OR 'FD' sum D.dttotrig else 0 end) AS "Valore
2 " ...
thanks
Mauro