Thursday, October 23, 2003


Source: Geekswithblogs.net Main Feed

Simple way to Remove Duplicate Rows from an Existing Table in SQL

SELECT DISTINCT *
INTO duplicate_table
FROM original_table
GROUP BY key_value
HAVING COUNT(key_value) > 1

DELETE original_table
WHERE key_value
IN (SELECT key_value
FROM duplicate_table)

INSERT original_table
SELECT *
FROM duplicate_table

DROP TABLE duplicate_table
[Geekswithblogs.net Main Feed]


9:41:12 AM    trackback []     Articulate [] 

Source: WebLogs @ ASP.NET

Typical IT Project :-).

[WebLogs @ ASP.NET]
9:33:38 AM    trackback []     Articulate [] 

 SOURCE: Erland Sommarskog has an interestng collection of articles on SQL. Worth a look !

This is a small collection of texts about some features in SQL Server that people frequently ask about in the newsgroups about MS SQL Server. Rather than being a FAQ with many questions with short answers, these are in-depth articles on some of my favourite topics

 

[WebLogs @ ASP.NET]
7:09:37 AM    trackback []     Articulate []