将 3 列合二为一

Add 3 columns in One

我昨天正在处理这个查询表,但没有找到任何答案。我不知道怎么做。

因此,我的查询结果如下:

代码:

select distinct Phase as tt  from table1
      where phase is not null

select distinct [ITV en cours] as tt from table1
      where [ITV en cours] = 'OUI'

select distinct Etat as tt from table1
      where Etat like 'Ass%'

我想做这样的东西

我该怎么做?

您可以执行 insert 或 union all 或 union 以获得所需的结果

select distinct Phase as tt from table1 where phase is not null
    union all
    select distinct [ITV en cours] as tt from table1 where [ITV en cours] = 'OUI'
    union all
    select distinct Etat as tt from table1 where Etat like 'Ass%'