Difference between revisions of "Postgres Query"

From WormBaseWiki
Jump to navigationJump to search
m (Blanked the page)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[http://www.wormbase.org/wiki/index.php/Caltech_documentation ''back'']
 
  
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 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 ~ ' ';
 

Latest revision as of 20:41, 24 September 2010