Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
03-19-2014, 01:18 PM #1
- Join Date
- Jun 2011
- Thanked 0 Times in 0 Posts
Sorting SQL data from one table using data from another
Hello one and all,
I need to be able to order the results from one data pull by the results from a second:
sql = "SELECT * FROM Players WHERE PL_Box_ID ="&BX_DB("BX_ID")
set PL_DB = doquerySQL(sql)
sql = "SELECT * FROM Scores WHERE SC_Box_ID ="&BX_DB("BX_ID")&" ORDER BY SC_Sets_Score, SC_Games_Score"
set SC_DB = doquerySQL(sql)
You have player information in the Players table and score results stored in the Scores table. I want to list the players in order of their current results total (Sets_Score and Games_Score) that is stored in the Scores table.
Originally I had the running totals in the Players table but that would not allow me to store historical data over a number of seasons so I moved them into their own table. Creating updating and storing the points works fine. Its just displaying the players in the right order that I can't achieve.
Any ideas? Thanks in advance.