Use a seguinte função:
trunc(42.4382, 2)

[1] http://www.postgresql.org/docs/8.4/interactive/functions-math.html

Em 26/10/2010 16:36, Fabrízio de Royes Mello escreveu:


Em 26 de outubro de 2010 17:20, Beto Lima <[email protected] <mailto:[email protected]>> escreveu:

    pessoal consegui fazer assim

    ((SELECT round(count(candidato_cpf),2) AS total FROM
    classificacao_inscrito
            where edital_id = 11 and cargo_id = 58 and
            cli_classif_aprovado = true) * 100 / (SELECT
    round(count(distinct candidato_cpf),2) AS total
            FROM resposta_questao
            where rpq_resposta is not null and
            edital_id = 11 and cargo_id = 58
            )) as indice_aprovacao


    usando o round ele me trouxe o valor correto, mas me apresenta em
    tela assim:
    9.3457943925233645

    teria como mostrar apenas 9.34 ???
    obs: alguém me corrija se estiver errado.



Tenta:

(round((SELECT round(count(candidato_cpf),2) AS total FROM classificacao_inscrito
        where edital_id = 11 and cargo_id = 58 and
cli_classif_aprovado = true) * 100 / (SELECT round(count(distinct candidato_cpf),2) AS total
        FROM resposta_questao
        where rpq_resposta is not null and
        edital_id = 11 and cargo_id = 58
        )),2)) as indice_aprovacao


--
Fabrízio de Royes Mello
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello


_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

--
Marcos
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a