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

[SQL] How to return the list and count of unique combinations based on a primary column

Discussão em 'Outras Linguagens' iniciado por Stack, Outubro 9, 2024 às 21:22.

  1. Stack

    Stack Membro Participativo

    I have the below table structure and want to return a count of the unique combination of relationships based on product. Relationships has 14 unique values

    customer ID relationship product ID
    123 Primary abc
    456 Secondary abc
    789 Other abc
    987 Primary xyz

    The final output I'm trying to achieve would be something like

    Relationship Type Relationship Count Product Count
    Primary, Secondary, Other 1 1
    Primary 1 1

    Continue reading...

Compartilhe esta Página