Uzdevums 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Genealogy and Family History Meta

Q&A about the site for expert genealogists and people interested in genealogy or family history

SELECT TOP 10
  Users.Id,
  Badges.Name,
  Users.Location,
  LastPost.LastPostId
FROM Users
LEFT JOIN Badges
  ON Badges.UserId = Users.Id
LEFT JOIN (
  SELECT OwnerUserId, MAX(Id) AS LastPostId
  FROM Posts
  WHERE PostTypeId = 1
  GROUP BY OwnerUserId
) LastPost ON LastPost.OwnerUserId = Users.Id
WHERE Users.Location LIKE '%Latvia%'
  AND Badges.Name = 'Editor';

Enter Parameters

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