Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select *
- from table ab
- left join table a on (a.id = ab.a_id)
- left join table b on (b.id = ab.b_id)
- -- where b.string occurs first
- order by ab.id
- ab.id | ab.a_id | ab.b_id | a.string | b.string
- -----------------------------------------------------
- 1 63 59 'good bye' > 'hello' -- appears first here
- 2 75 67 > 'hello' 'sounds good'
- 3 77 78 'have fun' 'awesome'
Add Comment
Please, Sign In to add comment