Expected table record after update.
So can you help to update this record using mysql query?
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
Assuming that all records with
wishlist IS NULL must be updated with the value taken from the closest previous (while sorting by
id ASC) record with non-NULL
UPDATE test SET wishlist = (@tmp := COALESCE(wishlist, @tmp)) WHERE (@tmp := -1) ORDER BY id ASC