How to select SUM or COUNT of rows with different condition

Describes a query that selects SUM or COUNT with specific WHERE condition.

Suppose we have this table –

Now we need to SUM all values of each column per user if the value is greater then 5 –

The similar query when we need to COUNT rows –

One thought on “How to select SUM or COUNT of rows with different condition”

  1. Я даже видео видел по этой теме. Сейчас скину ссылку, если найду.

Leave a Reply

Your email address will not be published. Required fields are marked *