Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about Stack Exchange APIs, Stack Exchange Data Explorer (SEDE), or any hacks to work with Stack Exchange sites.
4
votes
Accepted
SEDE Query to Find... Weird Question/Protect Combinations
One of the first things you should do if you have an arbitrary data set (as you do in your list of UserIds) would be to extract it out of the WHERE clause. Just make a @TempTable variable. If the data …
3
votes
Accepted
Find first questions with answers posted within 24 hours
I have to compliment you on how well your query reads. Your aliases are short enough not to be a PITA to reference, yet descriptive enough to not have to scratch your head about what they mean.
Your …
14
votes
Accepted
Oh my goodness: How many selfies have I taken?
One by one, then:
Is it good that I stored the posts in tables, or is it unnecessary?
It is unnecessary, in this case. What your table variables are doing for you here really is simulating a sel …
4
votes
Accepted
Archaeologist Progression
A thing of beauty
For such an odd/complicated logic, you certainly have made your code easy to follow along. Your comments are succinct and well used to label the CTEs.
Your CTE names are perfect for …
9
votes
Accepted
Naruto, where are you?
There is not a whole lot to say, but I found a few small things that could be improved.
Consistency
DECLARE @username as NVarchar(60) = RTRIM(LTRIM(##DisplayName:string? ##));
DECLARE @userId as int …
4
votes
The chatbot for The Community Post Pimping Board
A note on comments...
Almost all of your comments already say what the function code says, since you are using clear naming. However, you have a behemoth function main() that is completely void of com …
3
votes
Accepted
Retrieve high views per day questions with few answers
Overall
I think your query is pretty nicely written and returns useful information.
Use some variables to refer to repeated values, for example, the GETDATE() reference could just be declared as a va …
3
votes
Accepted
Who likes that post?
Overall, very good
I inspected your query closely and did not find anything standing out that could really be improved much. Here are some good points I found:
Your formatting is consistent and the i …
3
votes
Find Users by Most Badges
Nothing bad to say, really!
It's a pretty simple query so only so much can be said about it. Your keyword capitalization is consistent, your columns are well-referenced, overall nothing stands out. Th …
3
votes
Forgotten zombie killers
ORDER BY a.CreationDate DESC
I think it would make more sense to sort by ASC so older Zombies show up first. I also think that SELECT TOP 100 is more an obstacle than a help. Since the data only refr …
4
votes
SEDE-Query for Rep-Trivia
I may be mistaken but I was under the impression that !=was not good SQL practice, rather <> is preferrable.
e.g.
WHERE Reputation <> 101 AND Reputation <> 1 --Exclude users without repchanges
7
votes
Accepted
Top Python badged users from NYC
Questions
First to address some of your questions:
Would this sql work with all relational DB's that accept SQL?
No, it would not. In fact it's quite unrealistic (if not impossible) to write SQL q …
7
votes
Accepted
Percentage of questions that are unanswered or answered
Comments
Your comments are mostly clutter, and I mean that because your naming is good enough to where the comments are mostly irrelevant. Also, if you do need to make multi-line comment, you can use …
8
votes
Accepted
Popular questions by view count
Good things
You use good local variables, and you are consistent with your naming. The typical naming for T-SQL is using PascalCase, however there are no standards and snake_case or camelCase work jus …
4
votes
Accepted
Searching posts/comments by keywords
Let's start with your input parameters, since that is SEDE-specific. Did you know you can add parameter hints to make the experience easier for users? See the SEDE Help Page. So we could do something …