| Posted by Alexander Kuznetsov on 06/20/61 11:52 
You can try something like this:
 SELECT     qi_id,
 case
 when qi_injury = 1 then  'Injury'
 when qi_environmental = 1 then  'environmental'
 when qi_Equipment damage = 1 then  'Equipment damage'
 when qi_Vehicle = 1 then  'Vehicle'
 end
 AS type
 FROM qt_ins
 WHERE (qi_injury = 1) or (qi_environmental = 1 ) or
 (qi_equipment_damage = 1)
 or (qi_vehicle = 1)
 
 But it would be interesting to see why is your original query slow. Any
 additional infotrmation?
  Navigation: [Reply to this message] |