Lets say I have the following (2) tables:
[People Table]
ID Name
1 John
2 Suzy
3 Dave
[Request Table]
ID 1stChoicePersonRequested 2ndChoicePersonRequested 3rdChoicePersonRequested
1 1 2 3
2 2 NULL NULL
3 1 2 NULL
4 3 1 1
The results I am looking for in a query are the following:
NameID Name NumTimeRequested
1 John 4
2 Suzy 3
3 Dave 2
I need the results to tally the total number of times each person was requested regardless of which of the (3) columns they are included in. What is the best way to do this in SQL 2008? Thanks!
https://data.stackexchange.com/stackoverflow/q/122030/