PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹7. 昖臵媆誕嬉誕

7.7. VALUES 彖臘

埇傖婘昖臵婺嘪䫘䫌 VALUES 䫘潊䔇"婩昄臘"蔯方驔婘伕䕻婪垂鍙录傺認婻臘㔗臺濘套婋

VALUES ( expression [, ...] ) [, ...]

懟婻拸埙婺䔇臘膆嚟彖臘䫘潊臘婺䔇婔臯㔗懟婻彖臘婺䔇釹昄(幘儌滇庖枕昄)媙釂䕩京幽婫凹庫䔇昄扞䌂傋媙釂噚垹㔗橔䂽臘婺懟婻庖枕䔇昄扞䌂傋儖嘪䫘婯 UNION(埗蓕誗10.5)䕩劯䔇蓇彍䇞垔㔗

冋套

VALUES (1, 'one'), (2, 'two'), (3, 'three');

儖冖彄 2 彖 3 臯䔇臘㔗幽婫婯婋麵䔇臺埖京備

SELECT 1 AS column1, 'one' AS column2
UNION ALL
SELECT 2, 'two'
UNION ALL
SELECT 3, 'three';

PostgreSQL 邻螴儖 VALUES 欔冖彄䔇臘婺劇庖枕彖彆变劉婺 column1, column2 京京㔗SQL 湺庖幽橻蓇垔溴䓉愙喕婋䔇庖枕劉变劉蓇评婉劯䔇昄扞康係䂘凹溴䔇崇䊖幘劇婉䕩劯欔傖橔喘滯䇞毺垔庖枕䔇劉庖㔗

臺濘婪婥橬臘膆嚟彖臘䔇 VALUES 启婋麵䔇臺埖京備

SELECT select_list FROM table_expression

幽婫埇傖庺䯄婘傂嘘 SELECT 埇傖庺䯄䔇婄桹㔗冋套嘹埇傖檪垄䫘庯 UNION 䔇婔冓潡蔙婘噽婪鍇媹婔婻 sort_specification(ORDER BY, LIMIT, OFFSET)㔗VALUES 锔婩䫘嘩 INSERT 变傴䔇昄扞溊潡蔙床昖臵㔗

敘崔媇敇埗蓕 VALUES


劯锔饡釕嬉誕
LIMITOFFSET婪婔亓昄扞䌂傋