PrevUpHomeNext

right_join()

The right_join() method is similar to inner_join() except that its output includes every output of the right-hand query at least once. On PostgreSQL it's a wrapper for SQL's RIGHT JOIN. On sqlite it gets the same results by wrapping LEFT JOIN and swapping things around.

For any queries l, r, you can call l.right_join(r, condition) provided that:

l and r's value mappers will both be visible to condition.

l.right_join(r, condition) returns a conditional_junction with the following characteristics:

Example
const query<std::tuple<boost::optional<screen>, movie>> no_movie_left_behind =
    screens.right_join(movies, screens->current_movie_id == movies->id);

PrevUpHomeNext