说我有桌子:
table_name: animal
column_names:
"dog": 'f',
"cat": 'f',
"cow": 't'
.
.
.
如何显示列名“ cow”?
谢谢!
答案 0 :(得分:0)
唯一简单的方法-直接检查每一列:
select
case
when dog=true then 'dog'
when cat=true then 'cat'
when cow=true then 'cow'
end as col
from animal