INSERT ... SELECT

From SQLZOO
Revision as of 10:21, 17 July 2012 by Marek (Talk | contribs) (Created page with "'INSERT..SELECT' copies data from a SELECT into a table. <div class='ht'> <div class=params>schema:scott</div> <div> </div> <source lang=sql class='tidy'>DELETE FROM t_peep W...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

'INSERT..SELECT' copies data from a SELECT into a table.

schema:scott
DELETE FROM t_peep WHERE id>100
 
INSERT INTO t_peep
 SELECT population, name FROM cia
  WHERE region='Europe';
SELECT * FROM t_peep