I have a data in a table:
Called temp

PK Ent_id Amt1 Amt2
1 500 10 30
2 500 20 30
3 510 200 200


I want to write a query which will sumup amt1 for ent_id and put that in amt2.
1. When there is only one row (ent_id), in which case amt2 should be same as amt1.
2. When there are more than one row(with same ent_id) it should sum that amount and put it in amt2 as shown above.


I am able to write 2 queries for these 2 diffenent cases
but I want to do it in one query.

Can someone help please ??

Thanks a lot.