how to replace this query in sql server ?
DELETE FROM student
WHERE id=2
AND list_column_name='lastName'
OR list_column_name='firstName'
LIMIT 3;
There is no ORDER BY in your original query.
If you just want to delete an arbitary three records matching your WHERE you can use.
DELETE TOP(3) FROM student
WHERE id = 2
AND list_column_name = 'lastName'
OR list_column_name = 'firstName';
For greater control of TOP (as ordered by what?) you need to use a CTE or similar.
using CTE and TOP 3 where equal to LIMIT 3
;WITH CTE
AS (SELECT TOP 3 Studentname
FROM student
WHERE id = 2
AND list_column_name = 'lastName'
OR list_column_name = 'firstName')
DELETE FROM CTE
TOP 3 and FROM
ORDER BY.