UPDATE existing records

From SQLZOO
Revision as of 11:14, 17 July 2012 by Marek (Talk | contribs)

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

UPDATE can change an existing record.

schema:scott
DROP TABLE t_peep;
CREATE TABLE t_peep (id INTEGER, name VARCHAR(10));
INSERT INTO t_peep VALUES (1, 'Andrew');
INSERT INTO t_peep VALUES (2, 'Gordon');
UPDATE t_peep
  SET name = 'andy', id=39
  WHERE id=1;
SELECT * FROM t_peep
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense