Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Combined Where and having
create table #TempAccount (UserId int, ACID int) insert into #TempAccount values (100, 1), (100, 2), (100, 3), (100, 4), (101, 2), (102, 1), (103, 2), (103, 3), (103, 4) select * from #TempAccount Select USERID,ACID, ROW_NUMBER() over(partition by USERID order by USERID ) as rownumber into #abc from #TempAccount --WHERE rownumber < = 2 and ACID in (2,3) SELECT *,ROW_NUMBER() over(partition by USERID order by USERID ) as rownumber FROM #abc where ACID in (2,3) and having count(rownumber) >=2 --select ACID from #abc where ACID in (2,3) group by ACID HAVING COUNT(ACID) = 2 drop table #TempAccount
run
|
edit
|
history
|
help
0
Null as default value
20181117
count events by 2 shift cycles using CTE
Exam_Final
Función Borrar carácter inicial repetido
customer data
OFFSET FETCH Clause
Recursion and cte
TUAN 7_QLDT
Library Datebase