这种查询怎么做.动态指定字段 Scheduling表.有day1-day31这些字段select getdate() from Schedulinggetdate()当前日期为30,就为day30这个字段,如果1就为day1字段.这个怎么写. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select (case when month(getdate()) = 30 then day30 when month(getdate()) = 1 then day1 end) from Scheduling declare @sql varchar(100)set @sql='select day'+rtrim(day(getdate()))+' from Scheduling'print @sql --select day30 from Schedulingexec(@sql) --执行查询 关于日益增大的数据库文件? 刚我看下这两个SQL语句 like多行怎么处理? 数据库经常阻塞,一个进程被自己阻塞 急!SQL Server 2000安装过程中的问题 请问一个触发器 随机取值问题. 这段oracle函数怎么转换为sql函数 这两提,我都快疯了 用一条SELECT 语句返回,当月的第一天和最后一天的日期值(date型)。 关于XP家庭版安装SQL 2005问题 sql2000数据库 我想实现 这样一个语句
select (case when month(getdate()) = 30 then day30
when month(getdate()) = 1 then day1 end)
from Scheduling
set @sql='select day'+rtrim(day(getdate()))+' from Scheduling'
print @sql --select day30 from Scheduling
exec(@sql) --执行查询