select P.id from Posts P where exists ( select 1 from pos...

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
from Posts P
where
  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 = 17 -- migrated

  )

Enter Parameters

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