日期列和时间列的合并和分拆
合并:SELECT CONVERT(DATETIME,CONVERT(CHAR(8),日期列,112) + ' ' + CONVERT(CHAR(8),时间列,108)) FROM dbo.表A;
拆分:select convert(date, getdate()) as [Date], convert(varchar(8), convert(time, getdate())) as [Time]
合并:SELECT CONVERT(DATETIME,CONVERT(CHAR(8),日期列,112) + ' ' + CONVERT(CHAR(8),时间列,108)) FROM dbo.表A;
拆分:select convert(date, getdate()) as [Date], convert(varchar(8), convert(time, getdate())) as [Time]