TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Yong Kevin
NA
35
2.4k
Get the Average Score and display
Jan 28 2021 3:05 PM
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
Reply
Answers (
8
)
How to upload and save csv file
Table not updating