Re: WHERE - Mailing list pgsql-general

From Jaime Casanova
Subject Re: WHERE
Date
Msg-id c2d9e70e050509133220d80c70@mail.gmail.com
Whole thread Raw
In response to Re: WHERE  (Hrishikesh Deshmukh <hdeshmuk@gmail.com>)
List pgsql-general
On 5/9/05, Hrishikesh Deshmukh <hdeshmuk@gmail.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 ;)

pgsql-general by date:

Previous
From: Christopher Murtagh
Date:
Subject: Re: Trigger that spawns forked process
Next
From: Douglas McNaught
Date:
Subject: Re: Trigger that spawns forked process