1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

SQL COUNT all ROWS in Columns

Discussão em 'Outras Linguagens' iniciado por Stack, Janeiro 21, 2021.

  1. Stack

    Stack Membro Participativo

    I need to Count all Rows and write it into Columns in ORACLE SQL. It schould look like that (left as it is, right as it should look like):

    |A|B|C|D| |A|COUNT_A|B|COUNT_B|C|COUNT_C|D|COUNT_D|
    - - - - - ------- - ------- - ------- - -------
    |1|2|3| | ==> |1| 2 |2| 3 |3| 3 | | 0 |
    |1|3|4| | ==> |1| 2 |3| 3 |4| 3 | | 0 |
    | |3|4| | | | 2 |3| 3 |4| 3 | | 0 |


    I've tried serveral things like COUNT(*) OVER (PARTITION BY), UNION an so on

    Thank you in advance.

    Continue reading...

Compartilhe esta Página