CREATE TABLE cities (
name text,
population real,
altitude int -- (in ft)
);
CREATE TABLE capitals (
state char(2)
) INHERITS (cities);
INHERITS表示capitalsji继承cities表的结构,同时capitals表添加的数据在cities表中也能看到
如果只查询cities表的数据only关键字
select * FROM ONLY cities WHERE altitude > 500;