Viewing 4 posts - 1 through 4 (of 4 total)
Or even more simply...
DELETE D FROM
(SELECT ProductName, ROW_NUMBER()OVER(ORDER BY ProductName) AS RowNum
FROM dbo.T1) D
where RowNum > 1
January 29, 2010 at 4:15 pm
-- Two methods I really like (and plagiarized from people on here).
create table #ttemp
(cola int not null)
insert into #ttemp (cola) values (1)
insert into #ttemp (cola) values (1)
insert into #ttemp (cola)...
January 27, 2010 at 5:40 pm
Here is a CTE based solution....
; WITH EmployeesCTE
AS
(
SELECT ROW_NUMBER() OVER( PARTITION BY EmpID, EmpName ORDER BY EmpID ) AS RowNumber,
...
January 27, 2010 at 5:10 pm
Viewing 4 posts - 1 through 4 (of 4 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy