240 reputation
310
bio website
location
age 27
visits member for 3 years, 1 months
seen May 23 '13 at 12:38

May
20
awarded  Notable Question
Dec
27
awarded  Popular Question
Jul
13
awarded  Popular Question
Jun
8
awarded  Caucus
Apr
15
awarded  Notable Question
Mar
20
awarded  Yearling
Nov
22
awarded  Popular Question
Jul
20
awarded  Self-Learner
Apr
12
awarded  Editor
Apr
12
revised Avoiding temporary tables while sorting by a column in a different table
added explain output
Apr
12
asked Avoiding temporary tables while sorting by a column in a different table
Apr
12
accepted Use order from another select clause
Apr
12
comment Use order from another select clause
I received all of the needed stories by switching to LEFT JOIN and grouping by stories.vid instead of votes.vid. Now the hardest bit - how do I sort the records properly?
Apr
12
comment Use order from another select clause
This works great, for the given parameters. The problem is that there's two statuses for votes - 0 and 1. What I would like is for the given results to be sorted first by maximum votes of status 1, and if the maximum votes of status 1 equals to another records' max votes, then it would be sorted by the total number of votes - of status 0 and 1, that is. Another thing - this query doesn't return the records from the stories table if there is no record for it in the votes table. I don't want that.
Apr
12
asked Use order from another select clause
Mar
28
awarded  Teacher
Mar
28
answered How to use prepared statements within MySQL stored procedures?
Mar
28
asked How to use prepared statements within MySQL stored procedures?
Mar
21
awarded  Supporter
Mar
20
awarded  Student