34,576
社区成员
发帖
与我相关
我的任务
分享
select 'select month'+ltrim(month(getdate()))+' from 表A'
/*
select month6 from 表A
*/
exec('select month'+ltrim(month(getdate()))+' from 表A')
select 'select month'+ltrim(month(getdate()))+' from 表A'
/*
select month6 from 表A
*/
exec('select '+ltrim(month(getdate()))+' from 表A')
动态sql
exec('select month'+ltrim(month(getdate()))+' from 表A')