By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE Dressing
AS
SELECT 1 AS dressingID, 'a' AS dressingCode
UNION
SELECT 2, 'bcccc'
Records: 2 Duplicates: 0 Warnings: 0
SELECT * FROM Dressing
dressingID | dressingCode |
---|---|
1 | a |
2 | bcccc |
UPDATE Dressing set dressingCode='111'
WHERE dressingID=(SELECT d FROM ((SELECT MAX(dressingID) AS d FROM Dressing)) s)
Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM Dressing
dressingID | dressingCode |
---|---|
1 | a |
2 | 111 |