I trying to some calculation in sql query but getting syntax error .
select *,(if( balance_advance_payment>0 ) EightBktTot = EightBktTot - balance_advance_payment balance_advance_payment = balance_advance_payment - EightBktTot if( EightBktTot<0 ) ( EightBktTot=0 ) ) (if( balance_advance_payment>0 ) SevenBktTot = SevenBktTot - balance_advance_payment balance_advance_payment = balance_advance_payment - SevenBktTot if( SevenBktTot<0 ) ( SevenBktTot=0 ) ) (if( balance_advance_payment>0 ) SixBktTot = SixBktTot - balance_advance_payment balance_advance_payment = balance_advance_payment - SixBktTot if( SixBktTot<0 ) ( SixBktTot=0 ) ) (if( balance_advance_payment>0 ) FiveBktTot = FiveBktTot - balance_advance_payment balance_advance_payment = balance_advance_payment - FiveBktTot if( FiveBktTot<0 ) ( ) (EightBktTot + SevenBktTot + (SixBktTot/2) + (FiveBktTot/2)) as bed_dept_cal from trn_details;
Aucun commentaire:
Enregistrer un commentaire