RE: Re[4]: [SQL] Query to eliminate duplicates - Mailing list pgsql-sql

From Mario Filipe
Subject RE: Re[4]: [SQL] Query to eliminate duplicates
Date
Msg-id XFMail.981204154224.mjnf@uevora.pt
Whole thread Raw
In response to Re[4]: [SQL] Query to eliminate duplicates  (Sferacarta Software <sferac@bo.nettuno.it>)
List 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@uevora.pt
        http://neptuno.sc.uevora.pt/~mjnf (modificada em 26/11/98)

Attachment

pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re[2]: [SQL] Please help: How to determine largest of two num bers in a query?
Next
From: "Roderick A. Anderson"
Date:
Subject: Re: Re[2]: [SQL] Please help: How to determine largest of two num bers in a query?