subtract two row's values within same column using Mysql group by ID : I have table like shown below. I want to do partition and then subtract the values in the same column to get the difference.

Since there is no partition or equalent function available in the mysql
Can anyone get me an idea of how to do it..
I have worked out the partition but not the other part

SELECT ID,Date,@row_number:=CASE WHEN @ID=ID THEN @row_number+1 ELSE 1 END AS row_number,@ID:=ID AS ID,value
FROM table1, (SELECT @row_number:=0,@ID:='') AS t 
ORDER BY id,Date;

ID	           Date	       Value
1001	24-07-2017 09:43	10
1002	24-07-2017 09:43	11
1003	22-08-2017 21:42	10
1001	07-09-2017 20:33	11
1003	07-09-2017 20:33	44
1002	24-07-2017 09:43	55
1004	07-09-2017 20:33	66

[enter image description here][1]

Output should be:

rowno	ID	Date	          Value	Diff
1	  1001	24-07-2017 09:43	10	N/A
2	  1001	07-09-2017 20:33	11	1
1	  1002	24-07-2017 09:43	11	N/A
2	  1002	24-07-2017 09:43	55	44
1	  1003	22-08-2017 21:42	10	n/A
2	  1003	07-09-2017 20:33	44	34
1	  1004	07-09-2017 20:33	66	N/A

[enter image description here][2]


  [1]: https://i.stack.imgur.com/ijm9L.jpg
  [2]: https://i.stack.imgur.com/jwp1E.jpg