I have data like below and trying to get the count of each column per row . How to do it in a SQL/ POSTGRESQL ?
| Movie | Horror | Comedy |
|---|---|---|
| AAA | Y | Y |
| bbb | N | N |
| CCC | Y | N |
| DDD | Y | Y |
How to get the count of each column with a Y in POSTGRES with the expected output like this
| Category | count |
|---|---|
| Horror | 3 |
| Comedy | 2 |