Guest User

Untitled

a guest
Nov 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. SET @s:=0;
  2. SELECT `debt`, `credit`, @ s : = (`debt` - `credit`) + @ s AS `balance`
  3. FROM `recordsdetails`;
  4.  
  5. SET @s:=0;
  6. SELECT debt, credit, @s:=(debt-credit)+@s AS balance FROM recordsdetails;
  7.  
  8. SET @s = 0;
  9. SELECT debt, credit, @s:=(debt-credit)+@s AS balance FROM recordsdetails;
Add Comment
Please, Sign In to add comment