Can i use the following code for thatdownload gb whatsapp
Code:
SELECT
  id,
  customer_id,
  orders_tip,
  comment,
  IF(orders_tip = 0, amount, 0) AS debit,
  IF(orders_tip = 1, amount, 0) AS credit,
  @balance := IF(orders_tip = 0, @balance + amount, @balance - amount) AS balance
FROM
  customer_transaction,
  (SELECT @balance := 0) AS balance_init
WHERE
  customer_id = 25
ORDER BY
  id;