So I recently have been working on a SEDE query that outputs posts from a given Stack Exchange site that have bodies of less than 50 characters.
While I have figured out how to get the links to those posts, I would also like to get the usernames under which those questions were posted.
Here is my current code:
SELECT p.Id AS [Post Link], Len(Body) AS [Body Length], p.Score, p.ViewCount, p.Tags
FROM Posts p
WHERE Len(Body) < 50
AND p.PostTypeId = 1
ORDER BY Len(Body) DESC
What I have tried to do to get my desired result:
- While
p.OwnerUserIddoes produce a new column, it only produces the given user IDs, while I would like the username specifically. - However, if I change
p.OwnerUserIdtop.OwnerDisplayName, this only produces a blank column with nothing in it. - It also seems like if I try to call
u.OwnerDisplayName, it produces the errorLine 1: The multi-part identifier "u.OwnerDisplayName" could not be bound.
My question is: How can I also get the username of the original poster of the questions into its own column?
Revisions that include previous attempts (if it would be helpful to look at):
You just need to join to the
Userstable: