Fraser
Fraser

Reputation: 14246

MySQL AVG based on another column's value

I have the following Select statement where I am getting an average of a column

SELECT, tblTracks.*, AVG(tblTrackRatings.intRating) AS dblAverageRating,......

This is working fine, however, I would like to be able to get an average of only those ratings who have another column (bolDeleted) set to 0.

Is this possible?

Upvotes: 0

Views: 51

Answers (1)

Arth
Arth

Reputation: 13110

Did you try:

WHERE bolDeleted = 0;

Upvotes: 2

Related Questions