insert into #TempUserTable
查询
;with cte as
(
select *,row_number() over(partition by (userid) order by login_time) as 'rowrank'
from #TempUserTable
)
在')'
附近收到错误的错误语法答案 0 :(得分:2)
语法看起来很好,只需在最后添加你的选择。
;with cte as
(
select *,row_number() over(partition by (userid) order by login_time) as 'rowrank'
from #TempUserTable
)
select *
from cte
where rowrank = 1
答案 1 :(得分:1)
;with cte as
(
select *,row_number() over(partition by (userid) order by login_time) as 'rowrank'
from TempUserTable
)
SELECT *
INTO #tempusertable
FROM cte