| From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
|---|---|
| To: | Sergio Valdes Hurtado <svh(dot)pgsql(at)gmail(dot)com> |
| Cc: | Lista PostgreSql <pgsql-es-ayuda(at)postgresql(dot)org> |
| Subject: | Re: Reformula pregunta |
| Date: | 2005-12-09 19:24:21 |
| Message-ID: | 20051209192420.GC27670@surnet.cl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-es-ayuda |
Sergio Valdes Hurtado escribió:
> Es posible leer un registro y luego extraer datos desde los distintos
> campos del registro, pero no usando el nombre del campo, sino que su
> posición.
Claro! Es muy sencillo, solo tienes que normalizar la tabla.
create table notas_alumno (
id_alumno int8 not null references alumnos,
id_asignatura int4 not null references asignaturas,
num_test int2 not null,
nota int2 not null,
primary key (id_alumno, id_asignatura, num_test)
);
select * from notas_alumno where num_test = 3 and nota > 85;
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | daly santana sanchez | 2005-12-09 19:24:34 | Función de hora |
| Previous Message | Jaime Casanova | 2005-12-09 19:18:14 | Re: Reformula pregunta |