| From: | Mario Filipe <mjnf(at)uevora(dot)pt> |
|---|---|
| To: | Sferacarta Software <sferac(at)bo(dot)nettuno(dot)it> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | RE: Re[4]: [SQL] Query to eliminate duplicates |
| Date: | 1998-12-04 15:42:24 |
| Message-ID: | XFMail.981204154224.mjnf@uevora.pt |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
> select * from cursos;
> numero_aluno|codigo_disciplina|ano_lectivo|epoca|semestre
> ------------+-----------------+-----------+-----+--------
> 13427| 35|1998/1999 | 1|t
> 13427| 904|1998/1999 | 1|f
> 13427| 122|1998/1999 | 1|t
> 13427| 907|1998/1999 | 1|f
> 13427| 481|1998/1999 | 1|f
> 13427| 286|1998/1999 | 1|t
> 13427| 368|1998/1999 | 1|t
> 13427| 35|1998/1999 | 1|t
> 13427| 904|1998/1999 | 1|f
> 13427| 122|1998/1999 | 1|t
> (10 rows)
>
> create table temp as select distinct * from cursos;
> SELECT
> select * from temp;
> numero_aluno|codigo_disciplina|ano_lectivo|epoca|semestre
> ------------+-----------------+-----------+-----+--------
> 13427| 35|1998/1999 | 1|t
> 13427| 122|1998/1999 | 1|t
> 13427| 286|1998/1999 | 1|t
> 13427| 368|1998/1999 | 1|t
> 13427| 481|1998/1999 | 1|f
> 13427| 904|1998/1999 | 1|f
> 13427| 907|1998/1999 | 1|f
> (7 rows)
>
> DROP TABLE cursos;
> DROP
> alter table temp rename to cursos;
> RENAME
Thanks! I had thought about this a while ago... but then I forgott it!
Mario Filipe
mjnf(at)uevora(dot)pt
http://neptuno.sc.uevora.pt/~mjnf (modificada em 26/11/98)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Roderick A. Anderson | 1998-12-04 19:55:37 | Re: Re[2]: [SQL] Please help: How to determine largest of two num bers in a query? |
| Previous Message | Bruce Momjian | 1998-12-04 15:26:23 | Re: Re[2]: [SQL] Please help: How to determine largest of two num bers in a query? |