The Tech Pursuit
The Dev Shelf
Pages
Home
Interview Questions
About Me
April 7, 2011
Delete duplicate records from table in SQL Server
CREATE TABLE Skills
(
Technology NVARCHAR(100),
YearsofExp INT
)
SELECT * FROM Skills
INSERT INTO Skills
VALUES('C#',33)
DELETE
FROM Skills
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM Skills
GROUP BY Technology,YearsofExp)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment