Skip to main content
formatando código
Fonte Link
Math
  • 31,3mil
  • 15
  • 95
  • 132

select c.cpf_cnpj, case when length(c.cpf_cnpj) > 11 then 2 else 1 end case from (

select c.cpf_cnpj,
       case
          when length(c.cpf_cnpj) > 11 then
           2
          else
           1
       end case
  from (
        select '12345655551' cpf_cnpj
          from dual
        union
        select '01234567000115' cpf_cnpj
          from dual) c

select c.cpf_cnpj, case when length(c.cpf_cnpj) > 11 then 2 else 1 end case from (

    select '12345655551' cpf_cnpj
      from dual
    union
    select '01234567000115' cpf_cnpj
      from dual) c
select c.cpf_cnpj,
       case
          when length(c.cpf_cnpj) > 11 then
           2
          else
           1
       end case
  from (
        select '12345655551' cpf_cnpj
          from dual
        union
        select '01234567000115' cpf_cnpj
          from dual) c
Fonte Link
igor
  • 84
  • 1

select c.cpf_cnpj, case when length(c.cpf_cnpj) > 11 then 2 else 1 end case from (

    select '12345655551' cpf_cnpj
      from dual
    union
    select '01234567000115' cpf_cnpj
      from dual) c