Tuesday, November 28, 2017

ORACLE - How use conditional logic in select, decode() statement

When is in field pos_dbf_ze value "HO" (=hour) is used pos_bdf_mz. In another case is pos_bdf_mz divided by value 60.
select sum( decode( pos_bdf_ze, 'HO', pos_bdf_mz, pos_bdf_mz/60 ) )
from aukabl
where 
arb_ord_nr like '16%'

No comments:

Post a Comment