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