我有一个查询。我使用了一些模式。我想获得不同的架构表列名称。
select column_name
from information_schema.columns
where table_name='public.combine'
or table_name='kds.2014_new'
or table_name='public.point'
or table_name='spt.point'
当我运行此查询时,我得到0结果。我怎么解决这个问题?
答案 0 :(得分:1)
您必须将table_name
和table_schema
SELECT column_name
FROM information_schema.columns
WHERE (table_name = 'combine' AND table_schema = 'public')
OR (table_name = '2016_new' AND table_schema = 'kds')
OR (table_name = 'point' AND table_schema = 'public')
OR (table_name = 'point' AND table_schema = 'spt')