My database stores bowling scores from my bowling league. I have a table of bowlers' names and their previous year's averages and handicaps. I have another table to record current weekly league results.
My 2 Access data tables look like this
BowlerTable:
year
bowler_id
team_id
lyr_ave
lyr_hcp
ResultsTable:
year
week
bowler_id
team_id
game_num
score
average
handicap
The two tables are related by year, bowler_id, and team_id.
I wonder if it is possible, in a single SQL query using UNION or CASE or subqueries, to do the following:
SELECT year, bowler_id, team_id, lyr_ave, lyr_hcp
FROM BowlerTable
I know the above is possible, but then I want to:
Find each bowler's name in ResultsTable, count and display how many games they have bowled this year prior to a given week, and sum their total scores. In doing this, I also need to test to see if their current year's game count is < 15. If so, I need to use the value of lyr_ave from BowlerTable to help determine their current average.
So--can I do all this in a single SQL query to my database?
Bruce
There are only 10 kinds of people in the world--those who understand binary and those who don't.
My 2 Access data tables look like this
BowlerTable:
year
bowler_id
team_id
lyr_ave
lyr_hcp
ResultsTable:
year
week
bowler_id
team_id
game_num
score
average
handicap
The two tables are related by year, bowler_id, and team_id.
I wonder if it is possible, in a single SQL query using UNION or CASE or subqueries, to do the following:
SELECT year, bowler_id, team_id, lyr_ave, lyr_hcp
FROM BowlerTable
I know the above is possible, but then I want to:
Find each bowler's name in ResultsTable, count and display how many games they have bowled this year prior to a given week, and sum their total scores. In doing this, I also need to test to see if their current year's game count is < 15. If so, I need to use the value of lyr_ave from BowlerTable to help determine their current average.
So--can I do all this in a single SQL query to my database?
Bruce
There are only 10 kinds of people in the world--those who understand binary and those who don't.