Skip to content

Instantly share code, notes, and snippets.

@wuputah
Forked from anonymous/gist:66776
Created February 19, 2009 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuputah/66777 to your computer and use it in GitHub Desktop.
Save wuputah/66777 to your computer and use it in GitHub Desktop.
The query:
select episodes.id from episodes
left outer join links on links.link_id = episodes.link_id
where episodes.link_id > 0 and links.link_id is NULL
The Rails:
Episode.find(:all, :include => :link, :conditions => "episodes.link_id > 0 and links.link_id is NULL")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment