Here is my problem..
Actual Auction Ammanat id
7000 500 100 228,229
7000 100 100 228,229
7000 900 100 228,229
5000 0 0 230
I want result as given below
Actual Auction Ammanat Remaining id
7000 500 100 5550 228,229
7000 100 100 5550 228,229
7000 900 100 5550 228,229
5000 0 0 5000 230
Here, Remaining
is (sum(auction)-actual)
.
I am using PostgreSQL. But if anyone know solution in SQL Server, it will be OK.