SELECT (SELECT SUM(ammount) AS s
FROM journal
WHERE idoperation = 1) - (SELECT SUM(ammount) AS s
FROM journal
WHERE idoperation = 2)
SELECT SUM (s)
FROM
(
SELECT SUM(ammount) AS s
FROM journal
WHERE idoperation = 1
UNION ALL
SELECT SUM(ammount)*-1 AS s
FROM journal
WHERE idoperation = 2
) AS t1
Если проблема проявлялась только при ajax запросе, то стоило открыть url с параметрами в браузере (если запрос GET) или попробовать через Postman