Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 710 Bytes

update-rows-in-replacingmergetree-table.md

File metadata and controls

25 lines (19 loc) · 710 Bytes

Update rows in ReplacingMergeTree table

INSERT INTO rt(id, ver, name) VALUES(1, 3, 'Hillary')
  • rt - name of the ReplacingMergeTree table
  • id - primary key column (identifies unique rows)
  • ver - version column (we should increment it to overwrite row identified by id)
  • name - sample string column
  • (1, 3, 'Hillary') - we insert 3 into ver column (assume current version stored there is 2)

group: ReplacingMergeTree

Example:

SELECT * FROM rt FINAL;
┌─id─┬─ver─┬─name────┐
│  1 │   3 │ Hillary │
└────┴─────┴─────────┘