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
#1111064
-- 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)...
January 27, 2010 at 5:40 pm
#1109679
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
#1109670
This gives me syntax errors
January 27, 2010 at 3:34 pm
#1109636