Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

Update Single row which is latest row by ID

$
0
0
i have Stored Procedure which get table type,
name varchar(50)
last name (varchar(50)
key varchar(50)
and Sql Table with the same fields.
id int identity
name varchar(50)
last name (varchar(50)
key varchar(50)
i want to update the first@last name based on the key.
the key in the tablle can return on itself, but i want to take the row with the latest key
where the ID is the ighest (means find the last id with this key)
and update the first & last name.
how to do this?

Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>