【发布时间】:2020-04-02 02:56:43
【问题描述】:
我有两个select语句
1
select Start_Date
from table1 where Start_Date not in (
select End_Date
from table1)
2
select End_Date from table1
where End_Date not in (
select Start_Date
from table1
)
当我使用 union all 时,我想将两个 select 语句组合在不同的列中,它给我一列,其中包含两个查询的结果
select a.End_Date , b.Start_Date from
( select End_Date from table1
where End_Date not in (
select Start_Date
from table1
) ) a
join
(select Start_Date
from table1 where Start_Date not in (
select End_Date
from table1)
) b
on 1=1
它给我结果每条记录重复四次帮助我下一步做什么??
【问题讨论】:
-
结果的每一行的两个日期应该如何配对?
-
您能否展示一些示例输入和所需的结果?
标签: mysql