I am writing a postgres query where I ask to return each order for each user. In case of the user hasn't a order I would like to return Null instead of no return.
My current query:
Select Order.user_id,
User.name,
Order.id,
Order.value,
Order.item
FROM Order
Left Join User
On Order.user_id = User.id
it returns each user order but in case of user with no order, nothing is returned. How I can return Null (or any string) instead of no return? Thank you so much.
rightinstead ofleftif you want all rows from the rightmost table (users)