小编CSS*_*ell的帖子

从两个表中选择数据并按日期排序

I have two tables with data and need to combine them and order by date. I have the below query but the union keeps giving me an error.

SELECT 

AssetTitle,
AssetDate,
AssetTeaser,
AssetLink

FROM pressAssets WHERE AssetType=1 ORDER BY AssetDate ASC

UNION ALL

SELECT

BlogTitle,
BlogDate,
BlogEntry,
BlogLink


FROM

blogTempTable ORDER BY BlogDate ASC, AssetDate ASC;
Run Code Online (Sandbox Code Playgroud)

Can anyone help me with this?

sql sql-server union select

-2
推荐指数
1
解决办法
4572
查看次数

标签 统计

select ×1

sql ×1

sql-server ×1

union ×1