select原型写法
select非原型写法
例:
create table h1(
id int,
name varchar(100),
dt datetime
)
drop table h1
insert into h1 values(1,'huangyanhua','2009-02-03')
--1
select id,dt from h1
--2
select id,sa= dateadd(day,-1,dt), 转换后的日期=convert(varchar(10),dt,120)from h1
--3
select id,'the name is :'+name,datename(weekday,dt)as dt from h1
--4
select id,dateadd(day,-1,dt) as dt, convert(varchar(10),dt,120) as 转换后的日期 from h1