I am trying to update the row most recently added to my table by adding a WHERE clause and selecting the MAX 'dressingID' which is my primary key.
The function is working however it is returning every row instead of just the row with the largest ID.
Here is the query:
UPDATE Dressing set dressingCode='111' WHERE dressingID=(SELECT MAX(dressingID))
Table Name = Dressing
Primary Key = dressingID
I am trying to get a number from a QR code and pass to to the latest entry into the table, however it is updating every row for some reason, any help would be appreciated. Cheers!