Postgres Query

From WormBaseWiki
Revision as of 02:37, 13 May 2008 by Kyook (talk | contribs)
Jump to navigationJump to search

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 ~ ' ';