34,593
社区成员
发帖
与我相关
我的任务
分享
select a.id,a.AddTime from(
select top(1)KinshipProofID as id,AddTime from KinshipProof
union
select top(1)AbductedChildrenProofID as id,AddTime from AbductedChildrenProof
)as a
order by a.AddTime asc
;WITH cte AS (
select top(1)KinshipProofID as id,AddTime
from KinshipProof
order by AddTime ASC
),cte2 AS (
select top(1)AbductedChildrenProofID as id,AddTime
from AbductedChildrenProof
order by AddTime ASC
)
SELECT * FROM cte
UNION
SELECT * FROM cte2;