Re: Pregunta para leer un campo

Lists: pgsql-es-ayuda
From: Javier Rodriguez <jawibcn(at)hotmail(dot)com>
To: <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Pregunta para leer un campo
Date: 2007-11-08 14:42:27
Message-ID: BAY107-W3535F6B0323EA58ED5B103B58B0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-es-ayuda

Hola tengo la siguiente tabla
CREATE TEMP TABLE lliurament(
id_lliurament serial PRIMARY KEY,
data_entrega date default current_date,
resultat varchar(100) NOT NULL,
correctes varchar(2),
fallats varchar(2),
erronis varchar(2),
resultat_test float,
nota_lliur float DEFAULT 0.0 CHECK (nota_lliur >= 0),
id_exer int,

Los campos correctes, ffallats i erronis son campos derivados y el campo resultado sera un campo del tipo "FFE..E"
Donde un punto es un test correcto suma 1 punto
La E es erroneo resta -1 punto
La F es un fallo -0.2

Tengo que hacer una funcion que calcule los campos derivados pero no se como leer el campo resultado para comparar que caracteres, no se si hay alguna instruccion o algo o como se podria hacer
Gracias

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Javier Rodriguez <jawibcn(at)hotmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Pregunta para leer un campo
Date: 2007-11-08 18:28:19
Message-ID: 20071108182819.GQ2938@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-es-ayuda

Javier Rodriguez escribiĆ³:
> Hola tengo la siguiente tabla
> CREATE TEMP TABLE lliurament(
> id_lliurament serial PRIMARY KEY,
> data_entrega date default current_date,
> resultat varchar(100) NOT NULL,
> correctes varchar(2),
> fallats varchar(2),
> erronis varchar(2),
> resultat_test float,
> nota_lliur float DEFAULT 0.0 CHECK (nota_lliur >= 0),
> id_exer int,
>
> Los campos correctes, ffallats i erronis son campos derivados y el
> campo resultado sera un campo del tipo "FFE..E"

Este es un mal diseƱo. El campo resultat deberia ser una tabla
separada.

--
Alvaro Herrera Developer, http://www.PostgreSQL.org/
<inflex> really, I see PHP as like a strange amalgamation of C, Perl, Shell
<crab> inflex: you know that "amalgam" means "mixture with mercury",
more or less, right?
<crab> i.e., "deadly poison"