| number | date |
+--------+------------------------+
| p1 |2014-08-23 23:45:49.9902|
| p1 |2014-08-23 23:46:32.033 |
I have a table in SQL Server as above with thousands of records, I would like to be able to update the latest record
update tableA
set number='p2'
where date=????
Thanks in advance for the help
I used GETDATE()
to save the records
update tableA
set number='p2'
where date = (select max(date) from tableA)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With