CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 a MySQL question...

Print topic Send  topic

Author Message
feha
Posted: 07/02/2002, 2:14 AM

I would like in rating system to sort out the best rated sites ...
sum of rating/nr.votes ... how tot sort order this and display the site which has best rating compared vs number of votes...
The sum of ratings an nr of votes are on the same table but in two separate columns...
the mySQK query looks like:
---------------------------------------------------------------------
select comp_id , comp_rating, nr_votes from comp_register where comp_rating !=0 ORDER BY comp_rating desc
----------------------------------------------------------------------
What I would need is something like:
----------------------------------------------------------------------
select comp_id , comp_rating, nr_votes from comp_register where comp_rating !=0 ORDER BY round(comp_rating/nr_votes) desc ?????????
-----------------------------------------------------------------------
please for any help
thank You
feha








feha
Posted: 07/02/2002, 4:59 AM


I found it out my self , the solution is:

-----------------------------------------------------------------------
select comp_id , comp_rating, nr_votes from comp_register where
comp_rating !=0 ORDER BY comp_rating desc ,nr_votes desc
-----------------------------------------------------------------------

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.