sql 加一条虚拟数据

select * from ( 
      SELECT  [ID]
              ,date
              ,year([Date] ) as year
              ,[Production]
              ,[ArtificialOil]
       FROM  [dbo].[Sys_NationalCrudeOil] 
union all 
      SELECT '0' as [ID]
             ,'1000-01-01' as date 
             ,'' as year
             , '' as [Production]
             ,'' as [ArtificialOil]
)d   order by  Date 

猜你喜欢

转载自blog.csdn.net/baidu_29385797/article/details/81771592