select * from `cars` where
(TRIM(REPLACE(`oilcode`,'-','')) = 'A8040') or
(TRIM(REPLACE(`aircode`,'-','')) = 'A8040') or
(TRIM(REPLACE(`fuelcode`,'-','')) = 'A8040') or
(TRIM(REPLACE(`cabincode`,'-','')) = 'A8040') or
(TRIM(REPLACE(`otherCode`,'-','')) like '%~A8040~%') or
(TRIM(REPLACE(`oilcode`,'-','')) like '%~A8040~%') or
(TRIM(REPLACE(`aircode`,'-','')) like '%~A8040~%') or
(TRIM(REPLACE(`fuelcode`,'-','')) like '%~A8040~%') or
(TRIM(REPLACE(`cabincode`,'-','')) like '%~A8040~%')
or TRIM(REPLACE(`oiloem`,'-','')) = '151000295AA' or
TRIM(REPLACE(`airoem`,'-','')) = '151000295AA' or
TRIM(REPLACE(`fueloem`,'-','')) = '151000295AA' or
TRIM(REPLACE(`cabinoem`,'-','')) = '151000295AA'
ORDER BY `cars`.`uin` ASC