日期:2014-05-17 浏览次数:20496 次
Declare @sex
select @sex from R where no = '10001';
--正式内容:
select name(--如何+@sex+getDate()),age(--如何+@sex+getDate()) from R where no = '1001'
--正式内容:
SELECT CONVERT(VARCHAR(10), NAME) + CONVERT(VARCHAR(10), @sex)
+ CONVERT(VARCHAR(20), GETDATE()) ,
CONVERT(VARCHAR(10), age) + CONVERT(VARCHAR(10), @sex)
+ CONVERT(VARCHAR(20), GETDATE())
FROM R
WHERE no = '1001'
select
ltrim(@sex)+convert(varchar(10),getDate(),120) name,
ltrim(@sex)+convert(varchar(10),getDate(),120) age
from R
where no = '1001'
select name+convert(varchar(10),@sex)+convert(varchar(20),getDate()),convert(varchar(2),age)+convert(varchar(10),@sex)+convert(varchar(20),getDate()) from R where no = '1001'