SELECT TOP (90) q.Id,u.DisplayName AS "Asker", 'https://...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Computer Science Meta

Q&A about the site for students, researchers and practitioners of computer science

SELECT TOP (90)

 q.Id,u.DisplayName AS "Asker",
    'https://stackoverflow.com/users/' + CONVERT(VARCHAR, u.Id) AS AskerLink,
    au.DisplayName AS "Answerer",
    'https://stackoverflow.com/users/' + CONVERT(VARCHAR, au.Id) AS AnswererLink,
 
    'https://stackoverflow.com/questions/' + CONVERT(VARCHAR, q.Id) as Link,
    q.Body as QuestionBody,
    q.Tags,
    q.Title,
    a.Body AS HighestScoringAnswer

       from posts a 
       inner join (select r.Id,r.Tags, r.Title,r.Body,r.OwnerUserId, max(p.Score) Score
               from posts p 
               inner join posts r
               on p.ParentId = r.Id where p.PostTypeId = 2 
               and p.Score >= 0
               group by r.Id,r.Tags, r.Body,r.Title,r.OwnerUserId) q
       on a.ParentId = q.Id
       and a.Score = q.Score
       join Users u ON q.OwnerUserId = u.Id
       JOIN Users au ON a.OwnerUserId = au.Id
      
       
WHERE q.id >##qid##
ORDER BY q.id

Enter Parameters

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