1 Reply Latest reply on Jan 13, 2015 8:12 PM by Gary Graham-Oracle

    please help me build a query

    2786212

      Hi,

      I would highly appreciate if anyone could help me build a query with the following scenario:

       

      I have two table as below:

      APP_TABLE with following field (app_id,app_name)

      APP_RELEASE table with following following field (rs_id, app_id, release_env)

       

      Both tables are connected by app_id

       

      Example data below:

      app_table

      app_id      app_name     

      1              mars            

      2              moon       

      3              earth

       

      app_release table:

       

      rs_id            app_id          release_env

      1                 1                  Test

      2                 1                   Dev

      3                 1                   Test

      4                 2                    Prod

      5                 3                    Dev

      6                 2                    test

      7                 3                    preprod

      8                 1                    prod

       

      I need to create a query to find how many test, dev, preprod and prod env we have for each application. Output would be smiler like below:

       

      app_name        # of test      # of dev     # of prod

      mars                 2               1              1

      moon                1                0              1

      earth                                   1

       

       

      Sorry for the long email. Highly appreciate any help.

      Regards,