K
K
Kirill Zhilyaev2018-04-06 01:17:00
MySQL
Kirill Zhilyaev, 2018-04-06 01:17:00

AVG without considering one value?

How to choose the arithmetic mean of a column without considering one value?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman MySQL, 2018-04-06
@kirill_782

SUM(CASE WHEN <fieldname> = <значениекотороенеучитывается> THEN 0 ELSE <fieldname> END)
/
SUM(CASE WHEN <fieldname> = <значениекотороенеучитывается> THEN 0  ELSE 1 END)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question