🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-sqlserver
Article #26

- Delete Multiple Rows?

#26
From: Les Gainous
Date: Tue, 29 Oct 1996 00:00
18 lines
1312 bytes
I'm using MS-SQL Server 6.5 (but any generic SQL syntax would be
appreciated):

How can I delete multiple occurrences of a row within a table. I know
how to display the rows which are duplicated:

	select		col1,
			count(*)
	from		myTable
	group by	col1
	having 		count(*) > 1

But now that I have that listing, how can I delete the second (or third,
or...) occurrence of the row--preserving the first occurrence.

Thanks in advance!
Les
Technical Details
Message-ID: <3276F4A7.1842@earthlink.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f4bf8,e42b60ff2edc4f24,start
X-Google-Attributes: gidf4bf8,public
X-Google-Thread: 104de1,e42b60ff2edc4f24,start
X-Google-Attributes: gid104de1,public
X-Google-Thread: f6611,e42b60ff2edc4f24,start
X-Google-Attributes: gidf6611,public
X-Google-Thread: 11301e,e42b60ff2edc4f24,start
X-Google-Attributes: gid11301e,public
From: Les Gainous <lesgainous@earthlink.net>
Subject: - Delete Multiple Rows?
Date: 1996/10/29
Message-ID: <3276F4A7.1842@earthlink.net>
X-Deja-AN: 193306519
content-type: text/plain; charset=us-ascii
organization: The Gainous Windows NT Server
mime-version: 1.0
reply-to: lesgainous@earthlink.net
newsgroups: comp.databases.ms-sqlserver,comp.databases.theory,bit.databases.mssql-l,microsoft.public.sqlserver.programming
x-mailer: Mozilla 3.0Gold (Win95; I)