Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Rails code I wish for
- Genome.genes
- ## Long SQL equivalent
- # Assuming the type_id for a genome is 1 and type_id for a gene is 2
- SELECT feature.* FROM feature
- inner join feature_relationship on feature.id=feature_relationship.subject_id
- inner join feature featureGenome on featureGenome.id=feature_relationship.object_id
- WHERE feature.type_id = 2 and
- featureGenome.type_id=1;
Add Comment
Please, Sign In to add comment