declare @pagenum int = 85; select * into #temp from posts...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mi Yodeya Meta

Q&A about the site for those who base their lives on Jewish law and tradition and anyone interested in learning more

declare @pagenum int = 85;
select * into #temp from posts where year(CreationDate)=year(getdate())
alter table #temp drop column LastEditDate
alter table #temp drop column LastEditorUserId
alter table #temp drop column LastEditorDisplayName
alter table #temp drop column CommunityOwnedDate
select ROW_NUMBER()OVER(order by CreationDate desc) num,* into #out from #temp
select * from #out
where num between (@pagenum-1)*50000+1 and @pagenum*50000
order by CreationDate desc

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results