Select
column_name,
Case
When Exist (Select * from information schema.columns
Where table_name = 'table 1'
And column_name in (Select column_name
from information_schema.columns
Where table_name = 'table 1'))
Then 'populated'
Else 'not populated'
以结果结束
From
information_schema.columns
Where
table_name = ‘table 1'
--- case 语句不为左侧的每个单独的列名循环