pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mario Filipe <mjnf@uevora.pt>
To: Sferacarta Software <sferac@bo.nettuno.it>
Cc: pgsql-sql@postgresql.org
Subject: RE: Re[4]: [SQL] Query to eliminate duplicates
Date: Fri, 04 Dec 1998 15:42:24 -0000 (WET)
Message-ID: <XFMail.981204154224.mjnf@uevora.pt> (raw)
In-Reply-To: <5658.981204@bo.nettuno.it>

> 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)

view thread (2+ messages)

Message-ID: <XFMail.981204154224.mjnf@uevora.pt>
Permalink:  ../XFMail.981204154224.mjnf@uevora.pt/
Also on:    postgresql.org/message-id/XFMail.981204154224.mjnf@uevora.pt

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: mjnf@uevora.pt, sferac@bo.nettuno.it
  Subject: Re: [SQL] Query to eliminate duplicates
  In-Reply-To: <XFMail.981204154224.mjnf@uevora.pt>
  References: <5658.981204@bo.nettuno.it> <XFMail.981204154224.mjnf@uevora.pt>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox