By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version() |
|---|
| 10.6.5-MariaDB |
| id | amount |
|---|---|
| 1 | 0 |
| 2 | 100 |
| 3 | 0 |
| 4 | 0 |
| 5 | 200 |
| 6 | 0 |
| 7 | 0 |
| 8 | 300 |
| 9 | 0 |
| id | amount | amount_check | positive_value_counter |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 2 | 100 | 1 | 1 |
| 3 | 0 | 0 | 1 |
| 4 | 0 | 0 | 1 |
| 5 | 200 | 1 | 2 |
| 6 | 0 | 0 | 2 |
| 7 | 0 | 0 | 2 |
| 8 | 300 | 1 | 3 |
| 9 | 0 | 0 | 3 |
| id | amount | amount_check | positive_value_counter |
|---|---|---|---|
| 2 | 100 | 1 | 1 |
| 3 | 0 | 0 | 1 |
| 4 | 0 | 0 | 1 |