Created
February 14, 2018 15:16
-
-
Save yancya/6bda42d28bdd43f7e241c462831e3552 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TEMP TABLE hoge (id integer, name text); | |
WITH t(id, name) AS (VALUES (1, 'hoge'), (2, 'fuga'), (3, 'piyo')) | |
, t2 AS (INSERT INTO hoge SELECT id, name FROM t) | |
INSERT INTO hoge SELECT id * 10, name FROM t; | |
SELECT * FROM hoge; | |
-- id | name | |
-- ----+------ | |
-- 10 | hoge | |
-- 20 | fuga | |
-- 30 | piyo | |
-- 1 | hoge | |
-- 2 | fuga | |
-- 3 | piyo | |
-- (6 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment