Skip to content
Advertisement

SQL count products

I have table:

i need select from this table, when output will be:

any idea how to do this?

DB: oracle 12

Advertisement

Answer

Use conditional aggregation:

Depending on your database, there may be neater options available to express the conditional counts.

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