Hello, I have a table
id name state num
1 x in 10
2 x out 1
3 x in 5
4 x out 2
5 y ...
6 y ...
The expected result is to sum the num for 'in' and 'out' in one query and then calculate the difference, like
name numin numout diff
x 15 3 12
y ....
Thanks