Help - Search - Members - Calendar
Full Version: Order by ratings fix
The Nexus Forums > News, Rules and Feedback > Network News > Change Log > File Database
Dark0ne
Order by ratings fix
Fixed an issue where ordering by rating would not show any files that had an average rating of 10. It cannot order by rating AND number of ratings however, so files with a rating of 10 are not ordered by most ratings as well.

My mind's in a bit of a mental block at the moment so anyone who knows a little SQL and wants to tell me how I can get the order to order by rating AND ratings (rating being the average rating and ratings being the total number of ratings) please feel free to chip in wink.gif

Update - 08/02/08
Fixed it so ordering by rating also takes into account the number of ratings
Stormraven
Lies, Damn Lies, Statistics, and SQL

Quote from article

"When I read about the Developer Shed December Giveaway Contest in the most recent newsletter a thought occurred to me; given the nature of the Developer Shed Network of sites, there should be an objective, computer-driven way of determining the winner. To remove all question of subjective bias in determining the winner I would like to suggest an algorithm to do just this. I will use the data provided by the hits statistics on the Dev Articles site. This should prove to be an ideal way to achieve an unprejudiced solution."


to the article

http://www.devarticles.com/c/a/SQL/Statistics-and-SQL-Lies-or-Truth/



To the PDF

http://www.devarticles.com/index2.php?option=content&do_pdf=1&id=694


He uses multi variables to determine the result

Might not help but could jog your memory

His process using a database is very interesting.

Stormraven

To more interesting articles

http://www.devarticles.com/c/b/SQL/

biggrin.gif
Stormraven
I went to a new reply because the last one started acting buggy.

Specific help on use of 'and"

Quote

"You can combine AND and OR clauses anyway you want and you can use parentheses to define your logical expressions.

Here is an example of such a SQL query, selecting all customers with LastName 'Brown' and FirstName either 'James' or 'Paula':


SELECT * FROM Customers
WHERE (FirstName = 'James' OR FirstName = 'Paula') AND LastName = 'Brown'



The result of the SQL expression above will be:

FirstName

LastName

Paula

Brown


End Quote

I assume you can use "and" in the first and second case, that's what it says anyway.

Good use of parentheses to narrow down results.

But looks like you could (x and y) and z

You might have to declare variables as numeric rather than string...not sure.

Handy List of commands and usage here:

http://www.sql-tutorial.net/SQL-AND-OR.asp

Stormraven


biggrin.gif
Stormraven
Sorry, but this takes me back to the Stone Age when the navy asked me to set up a Unix system using a 286 as the server and 086 machines (the very first IBM PC’s introduced in 1981) as workstations, using a very early version of SQL for the "relational" data base.

What a nightmare! Classified (25+years ago) of course, so it was nearly impossible to ask for and get any help.

Had to figure it out myself using the arcane beta help manuals supplied by Santa Cruz.

In those days if you could read a manual they tossed it,
and wrote a harder one, I’m not kidding.

Makes me laugh now, just thinking about it.
36-hour day, 8-12 hours of sleep, followed by 36-hour day, 8-12 hours sleep,
on and on, round and round.
Talk about insanity. I didn't know what day it was unless i checked the computers BIOS.

I such a pack rat I’m sure those manuals are around here somewhere. Wife probably put them in storage years ago.

They probably belong in a museum. Come to think of it

No one told me at the time it couldn’t be done,
the technology and software couldn’t cope with the demands.

I heard plenty of that crap later though and couldn’t utter a word!

------------------------------------------------------------------------

Go ahead and bust me if you want but these edit boxes get funky after awhile.
Could be my browser though. I know, I know, get Firefox...
May the DarkOne please take pity on me and mash them together.

Stormraven

P.S.

to quote myself from another site,
"I don't give a rats ass about my post count"
So dont even start that with me. Please.

to quote the famous Ninja form the same website,
"Quality is more important than quantity."

the old man rumbled as he rambled away into the dark...

thanks.gif




Dark0ne
"ORDER BY rating DESC , ratings DESC" was all it needed
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.