Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Resolved error
create table #tmp(roleid int,comid varchar) insert into #tmp values(1,'A'),(1,'B'),(2,'C'),(2,'D'),(1,'A') select * from #tmp select roleid,comid, row_number() over(partition by comid order by roleid) as rno from #tmp -- How to get whose rno is > than 1 ? I tried like below. Why its not giving by my query ? --select roleid,comid, row_number() over(partition by comid order by roleid) as rno from #tmp --where rno > 1 --select rno,* from ( --select roleid,comid, row_number() over(partition by comid order by roleid) as rno from #tmp --where rno > 1 ) a where rno > 1 select rno, * from( select roleid,comid, row_number() over(partition by comid order by roleid) as rno from #tmp )a where rno > 1 drop table #tmp
run
|
edit
|
history
|
help
0
SQL query to find difference in text between different rows
bc160402152
employee table
mi
Create Date list (variable dates) - SQL Server
sql-server-storing-wildcards-in-data
1
SS mysqlsvr 2014 practice
TSQL - Logic driven by two most recent rows
sadasd