Difference between revisions of "Postgres Query"

From WormBaseWiki
Jump to navigationJump to search
m
Line 1: Line 1:
 
[http://www.wormbase.org/wiki/index.php/Caltech_documentation ''back'']  
 
[http://www.wormbase.org/wiki/index.php/Caltech_documentation ''back'']  
  
Query curation tables from this site:  
+
Query Variation-Phenotype Postgres curation tables from this site:  
  
 
[http://tazendra.caltech.edu/~postgres/cgi-bin/referenceform.cgi Postgres query page]  
 
[http://tazendra.caltech.edu/~postgres/cgi-bin/referenceform.cgi Postgres query page]  

Revision as of 02:37, 13 May 2008

back

Query Variation-Phenotype Postgres curation tables from this site:

Postgres query page

Some Queries from Juancarlos:

1) Find number of distinct genes associated with a phenotype via allele (I think it's just allele):

paste :

SELECT COUNT (DISTINCT app_wbgene) FROM app_wbgene;

and click ``Pg !

2) If you want to see them, paste :

SELECT DISTINCT app_wbgene FROM app_wbgene;

3) Find objects where the allele status is populated with a space

SELECT * FROM app_tempname WHERE joinkey IN (SELECT joinkey FROM app_allele_status 

WHERE app_allele_status IS NOT NULL AND app_allele_status != );

4) Find objects that have an allele status value

SELECT * FROM app_tempname WHERE joinkey IN (SELECT joinkey FROM app_allele_status);

5) Find lines where anatomy term field started with a space

SELECT * FROM app_anat_term WHERE app_anat_term ~ ' ';