The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
Newbie here. Hoping to get some help on this. I'm writing an MySQL database application that is basically a list of songs where users vote on them. I'm trying to figure out how to count the numbers in a particular table's column. For example, I have the following:
Database: SongDB
This Table: Ratings
This Table's Column: RateID (auto #), Rating (1-5), SongID (1-50)
I want to count or add up (SUM) each individual "Rating" and sort the list of songs on an ASP page in ascending (ASC) order based on its total rating.
Do I need to create a function to first add up the individual ratings, then select them in ascending order? If so, how would I write this code?
Here's what I have now that sorts the song list alphabetically by song title:<
Database: SongDB
This Table: Ratings
This Table's Column: RateID (auto #), Rating (1-5), SongID (1-50)
I want to count or add up (SUM) each individual "Rating" and sort the list of songs on an ASP page in ascending (ASC) order based on its total rating.
Do I need to create a function to first add up the individual ratings, then select them in ascending order? If so, how would I write this code?
Here's what I have now that sorts the song list alphabetically by song title:
Code:
"SELECT * FROM Songs ORDER BY SongTitle ASC"