|
Posted by Alexander Kuznetsov on 07/11/06 20:35
Thomas,
thanks for the correction. Untested again, no DDL, no DML!
SELECT qi_id, t.c AS type
FROM qt_ins join
(
select 1 n, 'Injury' c
union all
select 2 n, 'environmental' c
union all
select 3 n, 'Equipment damage' c
union all
select 4 n, 'Vehicle' c
) t
on (qi_injury = 1 and t.n=1) or (qi_environmental = 1 and t.n=2) or
(qi_equipment_damage = 1 and t.n=3)
or (qi_vehicle = 1 and t.n=4)
[Back to original message]
|