alexx876

Untitled

Jun 24th, 2021
656
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DELIMITER $$
  2. CREATE FUNCTION TRANSACTIONS_SUM (tr_status INT)
  3. RETURNS INT
  4. BEGIN
  5.     DECLARE allSum INT;
  6.     SELECT SUM(sum) INTO allSum FROM transactions WHERE status = tr_status;
  7.     RETURN allSum;
  8. END$$
  9. DELIMITER ;
  10.  
RAW Paste Data