Programatically Generating Tournament Summary Report

All issues and questions relating to Turbo Tourney should be posted here. Support members, forum moderators and other members can help you with your questions.
Post Reply
Boilers2000
Posts: 10
Joined: Tue Dec 16, 2014 10:21 pm
Old Username: sgstanton
Location: Indian Land, SC

Programatically Generating Tournament Summary Report

#1

Post by Boilers2000 » Tue Mar 07, 2017 1:22 pm

Greetings once again,

As those that have regularly seen my posts, I use the Turbo Tourney database feature extensively to dynamically build my web site with only a few reports actually coming from the software. I'm working on trying to leverage the database even more and want to see if any general SQL guru's may be able to help. The report I'm trying to mimic is the Tournament Summary report; the one that shows how many times a team was picked to win in each round. I've found in the playerPicksTeams table that each row has all of the columns necessary to extract the data. However, all I've been able to figure out to get a count for each game is this:

SELECT Region1_Round1_Game1_PickTeam , COUNT(*)
FROM playerPicksTeams
WHERE PoolID =1
GROUP BY 1
ORDER BY 1

This would, for example give me the first round game between the 1 and 16 seeds in the upper left region of the bracket and the counts of how many teams each was picked for that game. Now, I know I could then take that data and run a total of 63 queries for each game in the table to get the similar numbers and I could put them into a 2d array and then output the table. However, I'm wondering if anyone here knows of a way to get the count for each column/team combination in one query that I could then parse through to generate the output or if I need to run individual queries and create the data set that way?

I don't think there is another single table that easily grabs this information but that would be an option too. I'm guessing it will be a bit of a brute force method which is doable but would be fairly time consuming to gather the results of 63 queries, put them into an array, sort and output accordingly.

Boilers2000
Posts: 10
Joined: Tue Dec 16, 2014 10:21 pm
Old Username: sgstanton
Location: Indian Land, SC

Re: Programatically Generating Tournament Summary Report

#2

Post by Boilers2000 » Thu Mar 09, 2017 8:11 am

I got it worked out... still having to do more queries than I would like, but not nearly as much as I was thinking originally.

Post Reply