I have a table with an operation and an amount columns. The opearation is an ENUM with two values: "in", "out". amount is just an INT.
I would like to sum the amounts "in" and subtract the sum of the amounts "out" in a single query.
I can extract a single value at a time:
SELECT SUM(amount) as total_in
FROM movements
WHERE operation like "in"
but I have no idea how to do both in one query...

GROUP BYand aggregate functions.