查询过程中,如何将当前年月设置为列的标题 我想设置查询语句,将当前月份设置为列的标题,如select A.date as '当前年月'from A因为当前年月是随时间变换的,可以随着显示2011.7,2011.8,2011.9....应该怎么设置呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 exec('select A.date as ['+convert(varchar(6),getdate(),120)+'] from A') +exec('select A.date as ['+convert(varchar(6),getdate(),112)+'] from A') declare @sql varchar(4000)set @sql = 'select A.date as ['+convert(varchar(6),getdate(),112)+'] from A'exec(@sql) 有没有select就能显示,不用在exec中呢 有没有可能直接在select下显示的,无需exec执行? 各位大侠高手来帮忙,脑乱ING,请指教 在线等 解决上分! 审核的问题 请教一个sql查询 使用游标错误 请教一下关于 2008 Express R2 的报表服务器问题。 存储过程执行问题 我用VB程序动态的创建一个SQL数据库。。。在线等! 如何建一张与原有一样的表呢? 急求:请问我在企业管理里把数据库删除掉了,怎么恢复呀?我没有任何备份?:( 触发器问题,高手帮忙 sa查询表数据成功,插入数据提示对象名无效 使用C# 一次创建多个视图或存储过程
exec('select A.date as ['+convert(varchar(6),getdate(),120)+'] from A')
declare @sql varchar(4000)
set @sql = 'select A.date as ['+convert(varchar(6),getdate(),112)+'] from A'
exec(@sql)