Skip to content
Advertisement

Oracle DB sql group the table_names patterns into a group

I am trying to classify certain patterns of tables in individual groups and display the results this is fine i included a case statements and classified it but how to group the counts , let provide the sql logic and existing results and expected results so that it will be understood.

database is Oracle 11g

SQL Query

EXISTING RESULTS

EXPECTED RESULTS

how to achieve the expected results ? using any WITH CTE ?

please suggest a best possible way ?

Advertisement

Answer

Aggregate by the case expression:

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