Guest User

Untitled

a guest
May 27th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. ## Rails code I wish for
  2. Genome.genes
  3.  
  4. ## Long SQL equivalent
  5. # Assuming the type_id for a genome is 1 and type_id for a gene is 2
  6. SELECT feature.* FROM feature
  7. inner join feature_relationship on feature.id=feature_relationship.subject_id
  8. inner join feature featureGenome on featureGenome.id=feature_relationship.object_id
  9. WHERE feature.type_id = 2 and
  10. featureGenome.type_id=1;
Add Comment
Please, Sign In to add comment