Skip to content
Advertisement

Sequelize query. Multiple count depends on column name

I have working query:

It returns total count for all columns that has code=1081 and 1082 in “Region” table.

In “Region” table there is “code” row that has 5 different codes. It’s a primary key to GeograpicalAdministrativeAreas table.

enter image description here

I need to calculate for each column separated amount (not only for 1081 and 1082 in total how it is now).

So i want to have the result in this way (or instead of code and we can use row “name”):

Advertisement

Answer

Answer:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement