pretty simple query for u guys, im just new to this. here's the scenario - one table with 10 fields. On first aspx page, i do insert first 5 fields (programid is one of them). On the second aspx page, i update the same record entered in previous screen (same programid) for the next 5 fields. but the programid is not unique. one programid can have multiple records. I have an ID field which is unique and identity increment.
I need the query which can take the latest ID and the programid and then update only that record and not all records
e.g
update table a
set field 6='abc',...
where programid = @programid AND
ID = (select id from tablea where programid = @programid order by id desc)
I hope you get the idea
thanks in advance