0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-05-21 21:18:09 +00:00
Files

14 lines
257 B
Plaintext
Raw Permalink Normal View History

CREATE TABLE t1(a, b, c);
CREATE TABLE t2(x, y, z);
CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
UPDATE t1 SET a=x FROM t2 WHERE c=z;
END;
INSERT INTO t2 VALUES(1, 1, 1);
INSERT INTO t2 VALUES(2, 2, 2);
INSERT INTO t2 VALUES(3, 3, 3);