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
add-empty-rows-after-certain-records-in-a-table
QLSV
My data
exp7
DeletorWall
Using varaible
Try_Parse (Type Casting )
student
FirstTable
Dbms_20181cse0068