Hi,
I'd be immensly grateful for anyone who can help me out with this problem as it takes a small while to explain and so far I haven't been able to find a solution which doesn't rely on PHP to do some work...
Currently, the situation looks like this...
I have 2 tables... Table 1 consists of a long list of ID numbers and names. Table 2 consists of a long list of ratings for each of the names in Table 1. By using a LEFT JOIN I can easily mix the two together and pull out an average rating for each person in table one... Here's how it looks:
Table 1:
1 John
2 Lisa
3 Eldrid
4 Mr. SQL
Table 2:
1 94
1 23
2 55
4 99
4 97
By using the LEFT JOIN I create a mixed table of the two which conatains 2 columns. The name from Table 1, and the average rating for each person snatched from table 2:
Table 1 & 2
John 58.5
Lisa 55
Eldrid NULL
Mr. SQL 98
Now comes the actual problem... I have a third table I'd like to include which helps sort people from table 1 into groups. It contains only two relevant columns. 1 for the ID of the person in question, and 2 for the group he or she is sorted into:
Table 3
1 1
2 1
3 2
4 2
I'd like to create a query which works like the one above (LEFT JOIN) but is also able to filter by groups... As far as my knowledge goes I think one can only specify 2 tables when using LEFT JOIN, and if I simply do a normal query from all 3 tables I cannot get the names to show that have no ratings for them... What I mean is - Eldrid would not show up in my select :-(
Any and all help is highly appreciated with this matter,
Gazoo...