ผู้ใช้ Android อันดับต้น ๆ ในบาร์เซโลนา ไม่จำเป็นต้องใช้ตารางทั้งหมด
Top Android Users in Barcelona.It is not neccessary to use all the tables.
 Posts:  Id [ number]  PostTypeId [ number]  AcceptedAnswerId [ number]  ParentId [ number]  CreationDate [ time]  DeletionDate [ time]  Score [ number]  ViewCount [ number]  Body [ text]  OwnerUserId [ number]  OwnerDisplayName [ text]  LastEditorUserId [ number]  LastEditorDisplayName [ text]  LastEditDate [ time]  LastActivityDate [ time]  Title [ text]  Tags [ text]  AnswerCount [ number]  CommentCount [ number]  FavoriteCount [ number]  ClosedDate [ time]  CommunityOwnedDate [ time]  ContentLicense [ text] 
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id = p.OwnerUserId WHERE LOWER(Location) LIKE '%barcelona%' AND TagName = 'android' GROUP BY u.Id, TagName) SELECT * FROM USER_BY_TAG WHERE rank <= 1000 ORDER BY UpVotes DESC