SQL Tricky Update Query Interview Questions with Answers
You have following table "TestUpdate".
Q 1.) What would be the output of following query?
Q 3.) What would be the output of following query?
Q 1.) What would be the output of following query?
UPDATE Testupdate
SET ID = ID + (SELECT MAX(ID) FROM Testupdate)
SELECT *
FROM Testupdate
Ans:
Q 2.) What would be the output of following query? based on blow table
UPDATE Testupdate SET ID = ID + (SELECT MAX(ID) FROM Testupdate)
GO 2
UPDATE Testupdate SET ID = ID + (SELECT MAX(ID) FROM Testupdate)
Q 3.) What would be the output of following query?
UPDATE Testupdate
SET ID = ID + MAX(ID)
Ans:
Comments