Difference between revisions of "Postgres Query"
From WormBaseWiki
Jump to navigationJump to search (New page: Query curation tables from this site: [http://tazendra.caltech.edu/~postgres/cgi-bin/referenceform.cgi Postgres query page] Some Queries from Juancarlos: 1) Find number of distinct g...) |
|||
Line 1: | Line 1: | ||
+ | [http://www.wormbase.org/wiki/index.php/Caltech_documentation ''back''] | ||
+ | |||
Query curation tables from this site: | Query curation tables from this site: | ||
Revision as of 14:20, 23 April 2008
Query curation tables from this site:
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 ~ ' ';