我有两个表:
工作:
id w_date other stuff
1 2017-05-10
1 2017-05-08
3 2017-05-17
Run Code Online (Sandbox Code Playgroud)
家:
id h_date other stuff
1 2017-05-01
4 2017-05-06
1 2017-05-14
Run Code Online (Sandbox Code Playgroud)
现在我需要一个查询来获取 id 为 1 的所有日期。
就像是:
Select *
from (
select w_date as date
from work where id=1
),
(select h_date as date from home where id=1)
Run Code Online (Sandbox Code Playgroud)
结果应该是:
id date
1 2017-05-01
1 2017-05-08
1 2017-05-10
1 2017-05-14
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
select ×1