Welcome Guest, Not a member yet? Register   Sign In
sub query problems SOLVED
#4

[eluser]srpurdy[/eluser]
[quote author="Caio Russo" date="1272484084"][quote author="srpurdy" date="1272462560"]
Which is allow worst total points for example to not count on the points total. So if the championship has 10 races, id like to be able to only count 9 lets say. Dropping the worst race for each driver from the stats. Although how many drop off can be any number. So it can be 5 of 10 that count.

Hope that makes it a bit clearer.[/quote]

maybe you can make something like this:
Code:
sum(ilr_champ.points - ilr_champ.pen_pts + ilr_champ.bonus_pts) - (select min(ilr_champ.pen_pts) from table where driver_id = a.driver_id) //where a.driver corresponds to the current driver's record that's the driver at the moment.

it's something like that?[/quote]

Thanks for posting Smile

hmm more like
Code:
->select{'champ_points')->limit('3')->orderby('ilr_champ.points', 'desc')

but without limiting how many rows are outputed, just the amount of rows that are used for totaling the line below.
Code:
sum(ilr_champ.points - ilr_champ.pen_pts + ilr_champ.bonus_pts) as champ_points,

Hope that makes it clearer. Smile


Messages In This Thread
sub query problems SOLVED - by El Forum - 04-27-2010, 10:48 PM
sub query problems SOLVED - by El Forum - 04-28-2010, 02:49 AM
sub query problems SOLVED - by El Forum - 04-28-2010, 08:48 AM
sub query problems SOLVED - by El Forum - 04-28-2010, 03:18 PM
sub query problems SOLVED - by El Forum - 05-01-2010, 06:00 PM
sub query problems SOLVED - by El Forum - 05-02-2010, 06:10 PM
sub query problems SOLVED - by El Forum - 05-04-2010, 09:28 AM
sub query problems SOLVED - by El Forum - 05-08-2010, 01:45 PM
sub query problems SOLVED - by El Forum - 05-10-2010, 11:28 AM
sub query problems SOLVED - by El Forum - 05-10-2010, 11:37 AM
sub query problems SOLVED - by El Forum - 05-10-2010, 11:57 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 06:06 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 06:11 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 06:11 AM
sub query problems SOLVED - by El Forum - 06-07-2010, 07:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB