Guest User

Untitled

a guest
Jan 16th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. select *
  2. from table ab
  3. left join table a on (a.id = ab.a_id)
  4. left join table b on (b.id = ab.b_id)
  5. -- where b.string occurs first
  6. order by ab.id
  7.  
  8.  
  9. ab.id | ab.a_id | ab.b_id | a.string | b.string
  10. -----------------------------------------------------
  11. 1 63 59 'good bye' > 'hello' -- appears first here
  12. 2 75 67 > 'hello' 'sounds good'
  13. 3 77 78 'have fun' 'awesome'
Add Comment
Please, Sign In to add comment