question

priyas avatar image
priyas asked

Delete the first row in a table and get all the other row values

Hi, I was trying to delete the first row value in a table and also get the remaining results in the same query, could you please assist? Below is the delete query I was trying but doesn't delete DELETE TOP (1) FROM TESTTBL WHERE ENG_ID in (SELECT TOP (1) ENG_ID FROM TESTTBL where SECT_NAME='LASTTBL' and ENG_ID=1659 );
sql-server-2012
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image Kev Riley ♦♦ commented ·
Whats the first issue, that it doesn't delete, or that is doesn't 'get the remaining results in the same query' ?
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.