Re: blanking out repeated columns in rows - Mailing list pgsql-sql

From Masaru Sugawara
Subject Re: blanking out repeated columns in rows
Date
Msg-id 20020509072256.4921.RK73@sea.plala.or.jp
Whole thread Raw
In response to Re: blanking out repeated columns in rows  (Masaru Sugawara <rk73@sea.plala.or.jp>)
List pgsql-sql
On Thu, 09 May 2002 01:51:59 +0900
Masaru Sugawara <rk73@sea.plala.or.jp> wrote:

> 
> How about this method of appending sequences as unique indices?
> 
> 
> First:
> create temp sequence dna_rownum1;
> create temp sequence dna_rownum2;
> 
> Secand:
> SELECT setval('dna_rownum1', 1, false);   -- (1)
> SELECT setval('dna_rownum2', 1, false);   -- (2)
> SELECT (CASE WHEN t1.idx = t3.idx THEN t1.tag ELSE NULL END) AS tag,


I'm sorry. This one is simpler.

SELECT (CASE WHEN t1.oid = t2.idx THEN t1.tag ELSE NULL END) AS tag,              t1.gb_id,              t1.pos,
     t1.descrip FROM  dna AS t1,             (SELECT tag, MIN(oid) AS idx                 FROM dna               GROUP
BYtag             ) AS t2WHERE t1.tag = t2.tagORDER BY t1.tag, t1.oid;  
 



Regards,
Masaru Sugawara




pgsql-sql by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: Performance on update from join
Next
From: Ian Barwick
Date:
Subject: Re: having trouble w/ having clause...