Q&A for science fiction and fantasy enthusiasts
select 'site://q/' + cast(pwd.Id as nvarchar) + '|'
+ cast (pwd.Id as nvarchar) as [Post Link],
PostTypes.Name as Type, pwd.ParentId as [Post Link], parent.Tags,
pwd.CreationDate, pwd.DeletionDate, pwd.Score,
parent.CreationDate as [Parent CreationDate]
from PostsWithDeleted pwd
left join Posts p on p.Id = pwd.Id
left join Posts parent on parent.Id = pwd.ParentId
left join PostTypes on PostTypes.Id = pwd.PostTypeId
where p.Id is null --and pwd.Score > 0
--and (pwd.PostTypeId = 1 or parent.Id is not null)
and pwd.CreationDate >= '2015-08-22' and pwd.CreationDate < '2015-08-23'
order by pwd.Id desc