Re: Help with queries.

From: "Oliveiros d'Azevedo Cristina" <oliveiros(dot)cristina(at)marktest(dot)pt>
To: "Adrian Johnson" <oriolebaltimore(at)gmail(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Help with queries.
Date: 2010-09-21 16:11:51
Message-ID: 13622609C3E64F38B9187B90F12F3049@marktestcr.marktest.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Howdy, Adrian,
Please see my questions below

> snps table
>
> id | sample_id | chromosome | from | to |
> ----------------------------------------------------------------
> 1 1 chr1 10 11
> 2 1 chr1 14 15
> 3 2 chr1 14 15
> 4 2 chr1 9 10
> 5 3 chr1 14 15
> 6 3 chr14 35 36
> 7 3 chr14 39 40
> 8 2 chr14 39 40
> 9 2 chr14 43 44
> 10 1 chr14 43 44
>
>
> gene table:
>
> id | chromosome | from | to | genename
> 1 chr1 4 20 SRC
> 2 chr1 25 45 SRC
> 3 chr1 80 100 CSK
> 4 chr1 120 140 CSK
>
> My aim is to for a gene in gene table (SRC that has two ranges 4-20 and
> 25-45),
> I want to map all coordinates in snps table.

Please advice me,
What do you call coordinates to, exactly? Sorry, my genetics knowledge is
very poor.
You call the from and to fields coordinates?
Do they have the same meaning as the from and to fields from table snps ?
What does it mean to map all coordinates in table snps?
Do you wanna know which entries from snps map in the SRC gene?
Coordinates are the segment where the gene/sample fit in the chromosome? Is
my understanding correct ?

> Then I want to get those entries where sample 1 and sample 2 have in
> common and sample 1 and sampl3 in common.
>

Could you give an example of your desired output, for the data you have ?

>
> I do not know how to get these entries. Could any one help me please.
>
> thank you.
>
> adrian
>

Best,
Oliver

> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joshua Gooding 2010-09-21 17:53:34 available RPM package for 8.4.4?
Previous Message Oliveiros d'Azevedo Cristina 2010-09-21 15:02:22 Re: all the table values equal