select P.id as [Post Link] from Posts P where p.PostTypeI...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Engineering

Q&A for professionals, academics, and students working within the systems development life cycle

select P.id as [Post Link]
from Posts P
where
  p.PostTypeId = 1
  and exists (
    select 1
    from posthistory ph 
    where ph.postid = p.id 
     and ph.PostHistoryTypeId = 14 -- locked
  )
  and not exists (
    select 1
    from posthistory ph 
    where ph.postid = p.id 
     and ph.PostHistoryTypeId in (17, 12) -- migrated, deleted
  )

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results