a
,b
,c
,CASE CC WHEN 1 THEN
j/i
ELSE 0 END AS CC
FROM A
select
schemaname,
tablename,
tableowner
from
pg_tables
limit 10;
schemaname | tablename | tableowner
------------+------------------+------------
pg_catalog | pg_statistic | postgres
pg_catalog | pg_type | postgres
public | test_create_tab | postgres
public | test_create_tab1 | postgres
public | test_create_tab2 | postgres
public | test_create_tab4 | postgres
public | mr_dept | postgres
pg_catalog | pg_authid | postgres
pg_catalog | pg_attribute | postgres
pg_catalog | pg_proc | postgres
(10 行记录)
不知道通过上面的 sql 语句, 你是否能明白。
如果你要判断 某个表是否存在, 只需要在上面的 sql 的基础上, 增加 tablename = '你的表名'
开门--查水表