aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-07 15:24:07 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-08-07 15:24:07 +0000
commit507d210257a8e92246aae9d7bfa7c62f78d104ce (patch)
tree49b5c84a78e163a26eebffd14b6902816e5a7ef4
parent1438b790ed7385482bad70468b8efb6b2113570d (diff)
downloadusdx-507d210257a8e92246aae9d7bfa7c62f78d104ce.tar.gz
usdx-507d210257a8e92246aae9d7bfa7c62f78d104ce.tar.xz
usdx-507d210257a8e92246aae9d7bfa7c62f78d104ce.zip
SUM/COUNT replaced by AVG
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1227 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UDataBase.pas10
1 files changed, 5 insertions, 5 deletions
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;