Viewing 11 posts - 1 through 11 (of 11 total)
I did not change the code for the WinLossSum. Thanks again!
CREATE VIEW WinLossSum AS
SELECT Team, SUM(Result) Wins, SUM(Result^1) Losses
FROM WinLoss
GROUP BY Team
Results
TEAM......WINS......LOSSES
..A............ 6..............0...
..B............6..............0....
..C............ 4..............2...
..D............ 3..............2...
..E...............
August 20, 2014 at 9:33 am
Here you go!
Final MySQL:
SELECT Team, Wins, Losses, CAST(IF(Wins + Losses = 0,0.0,Wins / CAST(Wins + Losses AS Decimal(6,3))) AS Decimal(6,3)) Percentage, ((ABS((SELECT MAX(Wins ) FROM WinLossSum) - Wins )) +...
August 20, 2014 at 9:08 am
Actually I got it!!!
I adjusted the SQLfiddle statement needed a couple extra brackets to complete the addition before dividing by 2:
This now works!!!
((ABS((SELECT MAX(Wins ) FROM WinLossSum) - Wins ))...
August 20, 2014 at 7:43 am
This is very close but something else is slightly off...the third place team should be 2 games behind not 3
This was the SQLfiddle statement:
(ABS((SELECT MAX(Wins ) FROM WinLossSum) -...
August 20, 2014 at 7:39 am
This is the exact result...except it seems to be in MSSql...the web server runs MySql
I did some research after copying the code into the query and receiving errors...maybe this is...
August 19, 2014 at 8:53 pm
I connect to the server/table using phpMyAdmin I believe it is a MySQL database
The menu gives me the following options...
Browse
Structure
SQL
Search
Insert
Export
Import
Operations
Triggers
Thanks in advance if you have time later
Cheers,
David
August 19, 2014 at 6:12 pm
I appreciate all your help...there are no Ties (only wins and loses)
Sorry this may be a terrible question but how do I add the fields to make them calculate? When...
August 19, 2014 at 5:50 pm
I was looking at the SQL...question how do winner/loser to the sql table so when the score is entered it updates the Winner/Loser column? Or is there a better way?
I...
August 19, 2014 at 5:33 pm
I have attached the excel file.
The standings is not a true table...it looks to the "games" table and the standings are all calculated and sorted.
So I have created the table...
August 19, 2014 at 3:59 pm
I have attached the excel file.
The standings is not a true table...it looks to the "games" table and the standings are all calculated and sorted.
So I have created the table...
August 19, 2014 at 3:58 pm
1. You seem to be working on something different to SQL Server. I had to translate the code to test the code. (I am sql from phpMyAdmin a web database)
Let's...
August 15, 2014 at 1:23 pm
Viewing 11 posts - 1 through 11 (of 11 total)