34,837
社区成员




select
case when exists(select 1 from syscolumns where id=(select id from sysobjects where name='表名') and name='字段名1') then 字段名1 else '' end,
case when exists(select 1 from syscolumns where id=(select id from sysobjects where name='表名') and name='字段名2') then 字段名1 else '' end,
case when exists(select 1 from syscolumns where id=(select id from sysobjects where name='表名') and name='字段名3') then 字段名1 else '' end,
case when exists(select 1 from syscolumns where id=(select id from sysobjects where name='表名') and name='字段名4') then 字段名1 else '' end
from 表名