从SMALLDATETIME类型字段中取出年和月? 有SQL SERVER 数据表TABLE_1,其中有字段F1,数据类型是SMALLDATETIME。问题:怎样从F1中同时取出年和月? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @date smalldatetimeset @date=getdate()select year(@date) as 'year',month(@date) as 'month' 同时取出?declare @date smalldatetimeset @date=getdate()select convert(char(7),@date,120) as 'ym' select year(F1) as '年',month(F1) as '月' from TABLE_1 请教一条查询语句 连接超时 0分求助:小数点后面多出.000000000002 哪里能下载MS Server 2000??? sql汉字排序问题 请教:从两个不关联的表中生成数据 循环问题,使用游标过慢,有啥好方法? sql server profiler追踪到一些audit loginout,没占多少资源,这种错误可以忽略吗? SQL Server2000安装失败,提示配置服务器出错! 两个语法不懂,请帮忙解释一下,来者有分! 关于SQL递归函数的优化 这种需求sql-server能做吗?查了论坛上的帖子没有答案啊
select year(@date) as 'year',month(@date) as 'month'
declare @date smalldatetimeset @date=getdate()
select convert(char(7),@date,120) as 'ym'