Hi everyone,
I have a question on the TSQL Syntax.
Now, I have 2 table which is Service & Rating:
Service:
Rating:
As you can see, the Rating_Id in the Rating table has many Services_Id values = 1
Now I want to get the Average Rating Score and display on the webpage, the TSQL that I tried:
- SELECT AVG(r.Score),s.*
- FROM Services s
- FULL OUTER JOIN Rating r ON r.Services_Id = s.Services_Id
- GROUP BY s.Services_id, r.Services_Id
As I want to display, all the services that have and do not have ratings and for those that have ratings, I want to calculate Average Rating score.
How can I achieve that
Please help
Thank you