Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. select * from estimates, estimate_histories
  2. where AND estimates.deleted != 1
  3. AND estimates.status = 'won'
  4. and estimate_histories.id = (select top 1 id from estimate_histories where estimate_histories ON estimate_histories.estimate_id = estimates.id and estimate_histories.status = estimates.status order by estimate_histories.date)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement