Skip to content

Instantly share code, notes, and snippets.

@kennir
Created July 5, 2016 05:49
Show Gist options
  • Save kennir/a424c667717e850a1e785eca0f0fe8c8 to your computer and use it in GitHub Desktop.
Save kennir/a424c667717e850a1e785eca0f0fe8c8 to your computer and use it in GitHub Desktop.
Delete column in sqlite3
BEGIN TRANSACTION;
CREATE TEMPORARY TABLE t1_backup(a,b);
INSERT INTO t1_backup SELECT a,b FROM t1;
DROP TABLE t1;
CREATE TABLE t1(a,b);
INSERT INTO t1 SELECT a,b FROM t1_backup;
DROP TABLE t1_backup;
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment