szr-indicator-service/common/src/main/resources/tmp

20 lines
737 B
Plaintext

select exists (select from information_schema.tables where table_name = 'app_dic') as is_exists;
alter table app_dic add column if not exists t_alter varchar(255);
alter table app_dic drop column if exists t_alter;
drop table if exists app_dic;
select * from p_scene where scene_name like '%人%' or scene_remark like '%人%' or model_notes like '%人%';
--查询表字段和注释
select
col_description (pg_attr.attrelid, pg_attr.attnum) as comment,
format_type (pg_attr.atttypid, pg_attr.atttypmod) as type,
pg_attr.attname as name,
pg_attr.attnotnull as notnull
from
pg_class as pg_cla,
pg_attribute as pg_attr
where
pg_cla.relname = 'p_indicator'
and pg_attr.attrelid = pg_cla.oid
and pg_attr.attnum >0