From 507d210257a8e92246aae9d7bfa7c62f78d104ce Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 7 Aug 2008 15:24:07 +0000 Subject: SUM/COUNT replaced by AVG git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1227 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UDataBase.pas | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Game/Code/Classes') diff --git a/Game/Code/Classes/UDataBase.pas b/Game/Code/Classes/UDataBase.pas index 4dbb0334..e00965c4 100644 --- a/Game/Code/Classes/UDataBase.pas +++ b/Game/Code/Classes/UDataBase.pas @@ -329,16 +329,16 @@ begin 'INNER JOIN ['+cUS_Songs+'] ON ([SongID] = [ID]) ORDER BY [Score]'; end; 1: begin - Query := 'SELECT [Player], ROUND (Sum([Score]) / COUNT([Score])) FROM ['+cUS_Scores+'] ' + - 'GROUP BY [Player] ORDER BY (Sum([Score]) / COUNT([Score]))'; + Query := 'SELECT [Player], ROUND(AVG([Score])) FROM ['+cUS_Scores+'] ' + + 'GROUP BY [Player] ORDER BY AVG([Score])'; end; 2: begin Query := 'SELECT [Artist], [Title], [TimesPlayed] FROM ['+cUS_Songs+'] ' + 'ORDER BY [TimesPlayed]'; end; 3: begin - Query := 'SELECT [Artist], Sum([TimesPlayed]) FROM ['+cUS_Songs+'] ' + - 'GROUP BY [Artist] ORDER BY Sum([TimesPlayed])'; + Query := 'SELECT [Artist], SUM([TimesPlayed]) FROM ['+cUS_Songs+'] ' + + 'GROUP BY [Artist] ORDER BY SUM([TimesPlayed])'; end; end; @@ -359,7 +359,7 @@ begin end; end; - //if Result empty -> Exit + //if result is empty -> Exit if (TableData.RowCount < 1) then Exit; -- cgit v1.2.3