I have a table with a field type.
how can I check this field in the request:
I want to check it if type== 'a'
then bes= amount, bed= '-'
ELSE bed= amount, bes= '-'
bes and bed doesn't really exist in my table, but the amount (int)
this is my attempt:
SELECT billing.*,
CASE billing.type WHEN 'A' THEN billing.amount AS bes, '-' AS bed ELSE billing.amount AS bed, '-' AS bes END
FROM billing
... my searches were not useful
any solution ...
Pooya source
share