Uzdevums 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Open Source Meta

Q&A about the site for people organizing, marketing or licensing open source development projects

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