Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. SELECT accounts.id, accounts.name, calls.name subject
  2. FROM accounts
  3. INNER JOIN calls ON accounts.id = calls.parent_id
  4. WHERE accounts.id=(
  5. SELECT c.parent_id
  6. FROM calls c
  7. WHERE c.parent_id = calls.parent_id
  8. ORDER BY c.date_modified DESC LIMIT 1
  9. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement