您可以将其
VALUES用作内联表并加入其中,只需为其提供别名和列名即可:
join (values (1, 101), (2, 202), (3, 303), (4, 304)) as map(zone_number, output_type_id)on ...
从精美的手册中:
VALUES也可以在SELECt可能写有FROM子句的地方使用,例如在子句中:SELECt f.* FROM films f, (VALUES('MGM', 'Horror'), ('UA', 'Sci-Fi')) AS t(studio, kind)
WHERe f.studio = t.studio AND f.kind = t.kind;UPDATe employees SET salary = salary * v.increase FROM (VALUES(1, 200000, 1.2), (2, 400000, 1.4)) AS v (depno, target,increase)
WHERe employees.depno = v.depno AND employees.sales >= v.target;



