Q&A about the site for members of the workforce navigating the professional setting
CREATE TABLE #TableX( ord INT PRIMARY KEY ,name NVARCHAR(255)); INSERT INTO #TableX VALUES (3 ,'John') ,(5 ,'Mary') ,(8 ,'Michael') ,(10 ,'Steve') ,(13 ,'Jack') ,(20 ,'Peter') UPDATE #TableX SET ord = ( SELECT MIN(ord)+MAX(ord) FROM #TableX WHERE name IN ('Peter', 'Steve') ) - ord WHERE name IN ('Peter', 'Steve') SELECT * FROM #TableX