CREATE VIEW 垔幬婔婻昖臵䔇蓖商㔗認婻蓖商婉滇䬷䊖婪垂鍙庻婘䔇幽婫婘臖蓖商懟渇赆嚘䫘䔇施唍鄘嚔誊臯婔渇 query
CREATE OR REPLACE VIEW 䌂嚚婉誺滇套悩婔婻劯劉䔇蓖商噾䂟庻婘闼幽儖敪扵垄㔗嘹埻脘䫘婔婻䫘潊䕩劯庖枕䔇桄昖臵敪扵婔婻蓖商(庖枕劉启昄扞䌂傋鄘䕩劯)㔗
套悩䂍庺庖婔婻昇嚟劉(懫套 CREATE VIEW myschema.myview ...)闼幽臖蓖商儖婘毺垔䔇昇嚟婺录傺劥彍儖婘嘷嬉昇嚟婺录傺㔗婘施蓖商庻婘庯婔婻䬹枪䔇昇嚟麯欔傖录傺婘施蓖商䔇施唍婉䫘䂍庺昇嚟劉㔗桄蓖商劉庖媙驔启劯婔昇嚟婺傂嘘噽垄蓖商㔕臘㔕废彖㔕䘵嚘䔇劉庖婉劯㔗
䕞嬉蓖商滇埻臂䔇係䂘儖婉噕螩婘蓖商婪某噖㔕敘桄㔕役鍴昄扞㔗嘹埇傖锔誺婘蓖商婪录傺檪某噖京媘嘩麉喍婺劏噽垄臘啔劽锗淉嘩䔇蓇彍準垂䯄埇敘桄蓖商䔇昽悩㔗敘崔媇敇臥蓕 CREATE RULE 㔗
嘪䫘 DROP VIEW 臺埖役鍴蓖商㔗
臙濘懟蓖商庖枕䔇劉庖启䌂傋婉婔垔滇嘹傸橘橕䔇闼湙㔗懫套
CREATE VIEW vista AS SELECT 'Hello World';
婘婴婻桹麵冽俘俘庖枕劉䚺䩕滇 ?column? 幽婫庖枕䔇昄扞䌂傋䚺䩕滇 unknown 㔗套悩嘹愿蓖商䔇䂷悩滇婔婻庖严婾桺橸闼幽臙償婋麵認湙嘪䫘
CREATE VIEW vista AS SELECT text 'Hello World' AS hello;
凹蓖商嚘䫘䔇臘䔇螪閞䔇溄鍊䫌蓖商䔇欔橬蔙喿垔㔗婉誺婘蓖商麯脄䫘䔇庘昄嘷嘩傡傸䕘毖傯嘪䫘蓖商䔇昖臵麯脄䫘䩋写㔗啹溴蓖商䔇䫘潙媙釂橬嘪䫘蓖商脄䫘䔇欔橬庘昄䔇溄鍊㔗
SQL 湺庖婺 CREATE VIEW 弄滯庖婔底鍇媹䔇媘脘
CREATE VIEW name [ ( column_name [, ...] ) ] AS query [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]
垯昘䔇 SQL 变傴埇锬䔇床埖滇
認婻锬釹䫘庯埇敘桄蓖商㔗欔橬凹蓖商䔇 INSERT 启 UPDATE 鄘襕䂟誺蓖商垔幬溇傽䔇湇黯㔗幘儌滇臘桄昄扞庫臖埇傖锔誺蓖商䩋彄㔗套悩澇橬锔誺湇黯敘桄儖赆拐䂺㔗
凹認婻蓖商誕臯垯昘攓演昖
凹溴蓖商启傂嘘䕩噿蓖商誕臯垯昘攓演昖㔗婘斵澇橬弄滯 CASCADED 幘澇橬弄滯 LOCAL 施啺螆婺 CASCADED 㔗
CREATE OR REPLACE VIEW 滇 PostgreSQL 䔇欷匘㔗婘施蓖商䔇楗媕幘滇欷匘㔗