I have a table where i have to find the avg price of an item, the problem is that i have to exclude a payment option from the avg
lets say the table goes like this Example
I want to remove cash payments from this avg
CodePudding user response:
Just add a WHERE
statement to filter out cash payments.
SELECT AVG(total)
FROM yourtable
WHERE payment != 'cash'