SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE journal ( idoperation int, ammount int ); INSERT INTO journal VALUES (1, 200),(2,15),(1,150),(1,50),(2,10); SELECT SUM(ammount * (CASE WHEN idoperation = 1 THEN 1 ELSE -1 END)) AS result FROM journal ;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear