XS

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

SELECT u.Id AS [User Link],
                            CONCAT('https://stackoverflow.com/users/', u.Id) AS [Profile Link],
                            u.DisplayName,
                            u.Location,
                            u.WebsiteUrl,
                            u.AboutMe,
                            u.Views,
                            u.UpVotes,
                            u.DownVotes,
                            bounties.BountiesWon,
                            questions.QuestionsPosted,
                            answers.AnswersPosted
             FROM Users u
        
             JOIN (
                    SELECT DISTINCT UserId
                    FROM Badges
                    WHERE LOWER(Name) IN ('java', 'spring', 'ethereum', 'bitcoin', 'kubernetes', 'terraform') AND
                          Class IN (1, 2) AND
                          TagBased = 1
                  ) tag_badges
             ON tag_badges.UserId = u.Id
             
             LEFT JOIN 
             (
               SELECT Posts.OwnerUserId, COUNT(*) As BountiesWon
               FROM Votes
               JOIN Posts ON Votes.PostId = Posts.Id
               JOIN VoteTypes ON VoteTypes.Id = Votes.VoteTypeId
               WHERE VoteTypes.Name = 'BountyClose'
               GROUP BY Posts.OwnerUserId
             ) bounties
             ON bounties.OwnerUserId = u.Id
              
             LEFT JOIN
             (
               SELECT OwnerUserId, COUNT(*) AS QuestionsPosted
               FROM Posts
               JOIN PostTypes
               ON PostTypes.Id = Posts.PostTypeId
               WHERE PostTypes.Name = 'Question'
               GROUP BY Posts.OwnerUserId
             ) questions
             ON questions.OwnerUserId = u.Id
             
             LEFT JOIN
             (
               SELECT OwnerUserId, COUNT(*) AS AnswersPosted
               FROM Posts
               JOIN PostTypes
               ON PostTypes.Id = Posts.PostTypeId
               WHERE PostTypes.Name = 'Answer'
               GROUP BY Posts.OwnerUserId
             ) answers
             ON answers.OwnerUserId = u.Id
             
             WHERE LOWER(Location) LIKE '%copenhagen%' OR
                            LOWER(Location) LIKE '%bronshoj%' OR
                            LOWER(Location) LIKE '%frederiksberg%' OR
                            LOWER(Location) LIKE '%hillerã¸d%' OR
                            LOWER(Location) LIKE '%vasby%' OR
                            LOWER(Location) LIKE '%roskilde%' OR
                            LOWER(Location) LIKE '%viborg%' OR
                            LOWER(Location) LIKE '%aarhus%' OR
                            LOWER(Location) LIKE '%hvidovre%' OR
                            LOWER(Location) LIKE '%frederikssund%' OR
                            LOWER(Location) LIKE '%soborg%' OR
                            LOWER(Location) LIKE '%odense%' OR
                            LOWER(Location) LIKE '%holbaek%' OR
                            LOWER(Location) LIKE '%kongens lyngby%' OR
                            LOWER(Location) LIKE '%farum%' OR
                            LOWER(Location) LIKE '%gentofte%' OR
                            LOWER(Location) LIKE '%lystrup%' OR
                            LOWER(Location) LIKE '%ballerup%' OR
                            LOWER(Location) LIKE '%kokkedal%' OR
                            LOWER(Location) LIKE '%humlebaek%' OR
                            LOWER(Location) LIKE '%denmark%'

Enter Parameters

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