Hey all,

I've three tables (g2d, dgp and pocus), with a gene-name, a score and
some other information:

mysql> select * from dgp;
+--------+---------------+--------------+------------------------------+------------+--------+
| chr    | start         | stop         | gene_name             |
score   | strand |
+--------+---------------+--------------+------------------------------+------------+--------+
| chr13 | 69810099 | 70239331 | ENSG00000165659 | 738.681 |  -      |
| chr13 | 64676788 | 65600573 | ENSG00000184226 | 627.447 |  -      |
| chr13 | 59781822 | 59787282 | ENSG00000150506 | 619.467 |  +     |
....

And I've a table with a lot of gene-name's. Now I want to combine
these 4 tables into a fifth table, named score, wich list in the first
column all the gene names, and in the three succesive columns the
score for that gene from the g2d, dgp, and pocus tables,  if a score
is found. Otherwise the default value should be 0.00
Like this:

mysql> select * from score;
+------------------------------+-----------------+------------------+----------------------+
| gene_name               | score_g2d  | score_dgp   |  score_pocus  | 
+------------------------------+-----------------+------------------+----------------------+
 | ENSG00000165659 |  0.000         | 738.681       | 0.00               |
 | ENSG00000184226 |  123,123     | 627.447       | 0.00               |
 | ENSG00000999999 |  0.000         |  0.00           | 987,987          |
......

How should I construct my query? I've been trying for hours now, and
can't get it rigth. Thanks in advance.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to