Union all 分别排序

Create PROCEDURE [dbo].[JiuChanPinLiuTongJiLuProcess]
(
    @JiuChanPinId decimal(18,0)
)
AS
select * from (
select top 100 Percent UpdateDate 日期,''+ShouHuoName +''+ GouHuoName as 流通方式
                                  from VWJiuChanPinLiuTongJiLu where BCLiuTongLeiXingId=1 andJiuChanPinId=@JiuChanPinId order by UpdateDate)m
union  all
select * from (
select  top 100 Percent UpdateDate 日期,''+ShouHuoName+'' + GouHuoName  as 流通方式    from VWJiuChanPinLiuTongJiLu where BCLiuTongLeiXingId=2 andJiuChanPinId=@JiuChanPinId  order by UpdateDate)n
go
原文地址:https://www.cnblogs.com/chengpeng/p/2232157.html