MySQL Forums
Forum List  »  Newbie

Re: select all vaues, including those not in row
Posted by: Phillip Ward
Date: October 29, 2021 06:20AM

Something like this?

select 
  t0.x x0
, tbl.x x1
from 
( select 100 x
  union all 
  select 200 
) t0 
left join tbl 
     on   t0.x = tbl.x

+-----+------+
| x0  | x1   |
+-----+------+
| 100 |  100 |
| 200 | NULL |
+-----+------+

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: select all vaues, including those not in row
October 29, 2021 06:20AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.