with TopQuestionAnswers as ( select top 15 p.Id as Questi...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sitecore Meta

Q&A about the site for developers and end users of the Sitecore CMS and multichannel marketing software

with TopQuestionAnswers
as
(
    select top 15 
        p.Id as QuestionId
        , p.Score as QuestionScore
        , p.Title as Question
        , pp.Body as Answer
        , pp.Score as AnswerScore
    from Posts as p
        inner join Posts as pp
            on p.Id = pp.ParentId
    where p.PostTypeId = 1
        and pp.PostTypeId = 2
        and p.AcceptedAnswerId = pp.Id
    order by p.Score desc, pp.Score desc
)
select
    qa.*
    -- , t.TagName as [Tag]
from TopQuestionAnswers as qa
    -- inner join PostTags as pt
    --     on qa.QuestionId = pt.PostId
    -- inner join Tags as t
    --     on pt.TagId = t.Id;
go

Enter Parameters

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