![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
This particular query I am trying to do is using MySQL, but its probably the same with any relational database: Scenario: I have 20 tables, all structured exactly the same. Each one only has two columns, I'll call "week" which has a numerical value (1, 2, 3, etc.) and "team" which has a sports team name (bears, tigers, tunas, etc.). I'm trying to write a query that will query all 20 tables, for just a particular week #, where the team name is a particular team and give me a count. For example, for week #1, I want to know throughout all my tables, who picked the tigers to win. So on all the tables where week=1, how many values of "tigers" are there throughout all 20 tables. Obviously, the max value obtained would be 20, the min would be 0. It seems simple to me, but dangit I just can't get it to work. Any help is greatly appreciated! |
#3
| |||
| |||
|
|
I'm trying to write a query that will query all 20 tables, for just a particular week #, where the team name is a particular team and give me a count. |
![]() |
| Thread Tools | |
| Display Modes | |
| |