Skip to content

Instantly share code, notes, and snippets.

@erikh
Created August 21, 2009 18:01
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 erikh/172257 to your computer and use it in GitHub Desktop.
Save erikh/172257 to your computer and use it in GitHub Desktop.
select * from candidate_versions where updated_at between 'date1' and 'date2' and candidate_id=? union select max(updated_at) from candidate_versions where updated_at < 'date1' and candidate_id=? and rownum = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment