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

[SQL] Decode in oracle, with multiple condition

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

  1. Stack

    Stack Membro Participativo

    Select decode(a.Type,1,'ONE',2,'TWO',null ,'OTHER')||
    Decode (b.Active, 1 ,'Yes',0,'NO', null ,'NO'),
    count(*)
    from TypeTable a,
    Status b
    where a.id=b.id
    and a.type in(12,3,34,45,66);


    Now question is,

    I want to count those who has type 1 and other that in record Like

    Column1 | Column2
    ---------------+----------
    One | 10
    ONE
    Other that ONE | 20

    Continue reading...

Compartilhe esta Página