sprx97 / JCS

0 stars 0 forks source link

Add current conference/division to Teams table #3

Closed jkeena88 closed 8 years ago

jkeena88 commented 8 years ago

My only idea is if there's an easy way to have this updated based on our historical conference table. Like once per year this checks for the most recent record for each team from that table, then updates the Teams table where needed. Otherwise I'm also fine doing this manually - there are very few changes each year.

sprx97 commented 8 years ago

Actually, if we have the historical data, we could very easily have a query to find a current conference...

Select (Teams.name, Conferences.Division, Conferences.Conference) From Teams join with Conferences on Teams.ID=Conferences.TeamID where Conferences.LeftDate=NULL;

LeftDate=NULL would imply the current conference. Would be a bit trickier to find the "Conference for Team A in X year", but wouldn't take more than two queries.

sprx97 commented 8 years ago

Closing since all the work that needs to be done is covered by the other item.