MySQL Query problem

Job ID: 37830279

Budget: $10 – $30 USD

My query below doesnt work
i need ot.text AS order_total BUT ONLY WHEN ot.class = 'ot_total'
and i also need ot.title AS shipping_method BUT ONLY WHEN ot.class = 'ot_shipping'

my strategy below failed as it seems i can only use the ot.class condition in the normal WHERE clause near the bottom i.e
WHERE
o.orders_status = s.orders_status_id AND s.language_id = '1' AND ot.class = 'ot_total'

however this means ot.title will return data for the ot_total class but i want it for the ot_shipping class
im simply trying to add 2 conditions
1. return ot.text AS order_total for the ot.class = 'ot_total'
2. return ot.title AS shipping_method for the ot.class = 'ot_shipping'

i dont want ot.title for ot.class = 'ot_total'

so help me ? is this not possible or do i have to execute a completely sepearate query??
that seems a waste of code and resources...

i know i can do it in 2 seperate queries but i am tryin to combine it in one query
thanks

SELECT
o.orders_id,
o.customers_name,
o.payment_method,
o.payment_module,
o.date_purchased,
o.last_modified,
o.currency,
o.currency_value,
s.orders_status_name,
ot.text AS order_total WHERE ot.class = 'ot_total',
ot.title AS shipping_method WHERE ot.class = 'ot_shipping'
FROM
`orders` o
LEFT JOIN `orders_total` ot ON
(o.orders_id = ot.orders_id),
`orders_status` s
WHERE
o.orders_status = s.orders_status_id AND s.language_id = '1'
ORDER BY
o.orders_id
DESC
Related categories: PHP SQL MySQL Database Programming