Skip to content
Advertisement

Oracle SQL: select count of multiple distinct fields

I need to select id, type and count of rows with unique id-type combinations.

So I tried something like this:

Also the problem is type calculated while processing the query, so when I tried to do something like:

I got this:

Any suggestions?

Advertisement

Answer

You can use a subquery :

Then you can transform it as subquery ::

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