The error message I get says that the error is near the CASE WHEN statement at line 8. Any comments are welcomed and if possible suggestions to correct the error.
Code:
Select vendor,F.airline_code,F.invoice_nmr invoice_vendor,F.booking_nmr, sum(amount) total_factura , IF(tipo = 'CH',facturado,pagado) monto_pagado,tipo, concat(b_month,'-',b_year)