I would like to ask to make a query like the following table?
------------------------------------- ID Date Input Output Total -------------------
You can use SUM OVER function:
SUM OVER
SELECT *, SUM(Input + Output) OVER(PARTITION BY ID ORDER BY Date) AS Total FROM table_a