Cerb
Elite Member
Not complicated, right? Of course not, I just can't figure it out. I'm a SQL n00b.
There's a list of, let's say houses, and each has a type ID. Then, there's a table that has the type ID and type names matched. The results returned should have a single row for each type of house with the ID and then name, and the average square feet of that type. If that type is not in the table with the description, it should be ignored.
<- is cheap, and got the free super saver shipping, so yes, I have books on the way, one of these days 🙂
http://rafb.net/p/DavzV942.html (was attached code)
There's a list of, let's say houses, and each has a type ID. Then, there's a table that has the type ID and type names matched. The results returned should have a single row for each type of house with the ID and then name, and the average square feet of that type. If that type is not in the table with the description, it should be ignored.
Seems to work, but just gets back the numbers, not names. What do I need to do to get the names as another column? I've now forgotten details of some of what I tried, but SQL was having nothing to do with any of it 🙂.SELECT Houses.Type_ID, AVG (SqFt) As avgSqFt FROM Houses,Types GROUP BY Types.Type_ID ORDER BY Types.Type_ID
<- is cheap, and got the free super saver shipping, so yes, I have books on the way, one of these days 🙂
http://rafb.net/p/DavzV942.html (was attached code)