格式:
SELECT A,B from Table1
UNION ALL
SELECT C,D from Table1
例如:select getdate()
UNION ALL
select getdate()-7
注意:保证两列的数据类型一致,如过不一致则需要转换类型。
SQL将不同的列叠加为一列
最新推荐文章于 2023-06-29 15:19:15 发布
格式:
SELECT A,B from Table1
UNION ALL
SELECT C,D from Table1
例如:select getdate()
UNION ALL
select getdate()-7
注意:保证两列的数据类型一致,如过不一致则需要转换类型。