Re: WHERE

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Hrishikesh Deshmukh <hdeshmuk(at)gmail(dot)com>
Cc: Dann Corbit <DCorbit(at)connx(dot)com>, Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: WHERE
Date: 2005-05-09 20:32:27
Message-ID: c2d9e70e050509133220d80c70@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/9/05, Hrishikesh Deshmukh <hdeshmuk(at)gmail(dot)com> wrote:
> Hi,
>
> I have two tables with genes and its annotation and a bunch of
> parameters, i wanted to know what are the genes common to these two
> tables, so i wrote this query
>
> create table temp as select gene from dataTable1 intersect
> select gene from dataTable2;
>
> The resulting table has only genes list (one column).
>
> Now i want to retrieve gene annotation from datatable1, so how i guess
> one has to write a query select geneAnnotation from dataTable1 where
> genes= " temp table";
>
select * from datatable1 where genes in (select gene from temp);

Actually, i don't like the name "temp" for a table it seems error prone.

--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

In response to

  • Re: WHERE at 2005-05-09 20:05:03 from Hrishikesh Deshmukh

Browse pgsql-general by date

  From Date Subject
Next Message Douglas McNaught 2005-05-09 21:01:21 Re: Trigger that spawns forked process
Previous Message Christopher Murtagh 2005-05-09 20:13:24 Re: Trigger that spawns forked process