with Min_Q2 as ( select top 50000 ViewCount from Posts or...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Internet of Things Meta

Q&A about the site for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors

with Min_Q2 as (
select top 50000 ViewCount
from Posts
order by ViewCount desc
) 
Select MIN(ViewCount) AS TempVar into #temp2 from Min_Q2
GO 
Select TOP 1 Id
,PostTypeId
,AcceptedAnswerId
,ParentId
,CreationDate
,DeletionDate
,Score
,ViewCount
,REPLACE(REPLACE(REPLACE(Body, CHAR(13), ''), CHAR(10), ''), ',','') AS Body
,OwnerUserId
,OwnerDisplayName
,LastEditorUserId
,LastEditorDisplayName
,LastEditDate
,LastActivityDate
,REPLACE(Title,',','') As Title
,Tags
,AnswerCount
,CommentCount
,FavoriteCount
,ClosedDate
,CommunityOwnedDate
,ContentLicense
from Posts
where ViewCount < (Select TempVar from #temp2)
order by ViewCount desc

--Select * from Posts where ViewCount = 127754
--Select * from Posts where ViewCount = 127754
--Select * from Posts where ViewCount = 127754
--Select * from Posts where ViewCount = 127754

Enter Parameters

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