pgsql数据库中含有某一字段

select distinct relname,attname,att.attbyval,att.
from pg_attribute att, pg_class b
where b.oid = att.attrelid
and att.attname like’%dept_id’ --可以模糊查询 ‘%nxxi%’
and attinhcount in (0)
and b.relkind in (‘r’)
order by b.relname;

你可能感兴趣的:(数据库,sql,java)