Inserting and updating data with REPLACE
Add data to the table using REPLACE INTO:
Note
We assume that you already created tables in step Creating a table and populated them with data in step Adding data to a table.
REPLACE INTO episodes
(
series_id,
season_id,
episode_id,
title,
air_date
)
VALUES
(
2,
5,
12,
"Test Episode !!!",
CAST(Date("2018-08-27") AS Uint64)
)
;
-- COMMIT is called so that the next SELECT operation
-- can see the changes made by the previous transaction.
COMMIT;
-- View result:
SELECT * FROM episodes WHERE series_id = 2 AND season_id = 5;
COMMIT;