我正在尝试编写应该返回具有特定值
的列名的查询例如
column_1 column_2 Column_3 Column_4 Column_5 Column_6
good good good very good Very good bad
我要获取其值很好且非常好的列名
由于
答案 0 :(得分:1)
SELECT column_1, column_2, Column_3, Column_4, Column_5, Column_6
FROM dbo.TableName
WHERE column_1 IN ('good', 'very good')
OR column_2 IN ('good', 'very good')
OR column_3 IN ('good', 'very good')
OR column_4 IN ('good', 'very good')
OR column_5 IN ('good', 'very good')
OR column_6 IN ('good', 'very good')
(顺便说一下,你的列名称都是坏的,没有意义)