Em 03/04/2012 07:25, Pedro Costa escreveu:
> Pessoal este update retorna apenas números inteiros apesar de o campo
> percentagem ser double precision:
>
>
> update estacionamento
> set percentagem = ((select count (n_passeio) from passeios where
> estacionamt =4)*100)/(select count(n_passeio)from passeios)
> where classe like '4';
>
>
tente o seguinte:
update estacionamento set percentagem = ((select count (n_passeio) from 
passeios where estacionamt =4)::numeric*100)/(select 
count(n_passeio)from passeios)::numeric where classe like '4';

-- 
Irineu Raymundo
Programador/Consultor Técnico
Senda Engenharia de Dados Ltda.

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

Responder a