Started By
Message

re: A request of the tigerdroppings DBAs

Posted on 3/18/18 at 4:07 pm to
Posted by vuvuzela
Oregon
Member since Jun 2010
14663 posts
Posted on 3/18/18 at 4:07 pm to
I have a feeling he is represented well in top 5 downvoted
Posted by PsychTiger
Member since Jul 2004
99001 posts
Posted on 3/18/18 at 4:08 pm to
Any calculations that don’t have him as the clear #1 are inherently flawed.
Posted by lsucoonass
shreveport and east texas
Member since Nov 2003
68462 posts
Posted on 3/18/18 at 4:15 pm to
How about a single post?

Got to be hammer time
Posted by biglego
Ask your mom where I been
Member since Nov 2007
76307 posts
Posted on 3/18/18 at 4:21 pm to
quote:

Hammertime's "Check His Knuckles First" thread had over 1,200 downvotes. It occasionally gets bumped, so new downvoters can add to the tally.

A truly amazing thread. Last time it was bumped I think it had about 2400 downvotes.
Posted by MrSmith
Member since Sep 2009
8311 posts
Posted on 3/18/18 at 4:31 pm to
quote:

This would return the top 5 most upvoted and downvoted posters. OP asked for most upvoted and downvoted POSTS.


SELECT u.id, u.username, p.id, SUM(p.downvotes) as total
FROM users u
LEFT JOIN posts p
ON p.user_id = u.id
GROUP BY p.id
ORDER BY total DESC
LIMIT 5
Posted by foshizzle
Washington DC metro
Member since Mar 2008
40599 posts
Posted on 3/18/18 at 5:53 pm to
quote:

SELECT TOP 5 Poster, COUNT(*) as CNT
FROM VoteTable
WHERE VoteType = 'UP'
GROUP BY Poster
ORDER BY 2 DESC


Sigh. With all the bad grammar on this board I'll have to call you out on this too. Since "TOP 5" is a SQL Server construct I'll assume you aren't using Oracle.

That said, it's bad form to write this:

quote:

ORDER BY 2


Instead, explicitly name the column;

quote:

ORDER BY COUNT(*)


This improves readability plus it removes the possibility of miscounting the column number.
Posted by antiventura
Member since Aug 2007
69 posts
Posted on 3/18/18 at 9:00 pm to
I'd love to run some queries against this database.

1. User submitting most upvotes
2. User submitting most down votes
3. Oldest currently active member
4. User who misspells ridiculous most frequently
5. Etc.
Posted by BruceJender
Houston
Member since Dec 2016
620 posts
Posted on 3/18/18 at 9:25 pm to
“Johnny Jones is not the problem” thread on the rant got over 500 in a little over an hour.
Posted by Draconian Sanctions
Markey's bar
Member since Oct 2008
84857 posts
Posted on 3/18/18 at 9:30 pm to
This

quote:

would return the top 5 most upvoted and downvoted posters.


would be more interesting than this

quote:

OP asked for most upvoted and downvoted POSTS.


Posted by fallguy_1978
Best States #50
Member since Feb 2018
48534 posts
Posted on 3/18/18 at 9:33 pm to
quote:

SELECT TOP 5 Poster, COUNT(*) as CNT 
FROM VoteTable 
WHERE VoteType = 'UP' 
GROUP BY Poster 
ORDER BY 2 DESC

You probably will have to incorporate some table joins baw. Surely TDs database isn't that flat.
Posted by tigercross
Member since Feb 2008
4918 posts
Posted on 3/18/18 at 9:38 pm to
quote:

You probably will have to incorporate some table joins baw. Surely TDs database isn't that flat.


Votes seem to be a CSS feature and probably aren’t stored anyway, so this is just a thought exercise. Which the poster you quoted did not pass.
Posted by DarthRebel
Tier Five is Alive
Member since Feb 2013
21243 posts
Posted on 3/18/18 at 10:06 pm to
quote:


You probably will have to incorporate some table joins baw. Surely TDs database isn't that flat.


Have you seen how slow this place runs sometimes


Posted by MrSmith
Member since Sep 2009
8311 posts
Posted on 3/18/18 at 10:10 pm to
It's one big jsonb field
Posted by fallguy_1978
Best States #50
Member since Feb 2018
48534 posts
Posted on 3/18/18 at 10:14 pm to
quote:

Have you seen how slow this place runs sometimes

Chicken probably needs to do an index evaluation or invest in an all flash array
Posted by foshizzle
Washington DC metro
Member since Mar 2008
40599 posts
Posted on 3/19/18 at 8:50 am to
quote:

Chicken probably needs to do an index evaluation or invest in an all flash array


It's almost certainly some VM's behind AWS or Azure.
first pageprev pagePage 2 of 2Next pagelast page
refresh

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram