![]() |
SQL deleting
How do I delete tables/colums? =O
|
For tables, you can just do:
NPC Code:DROP TABLE table_name Columns are a bit more tricky, because it turns out that SQLite has limited support for altering columns... you can check out: http://www.sqlite.org/faq.html#q11 |
It's a good thing to vacuum after dropping a table.
NPC Code: |
Quote:
NPC Code: e.g. NPC Code: EDIT: Sorry, I misread; I think that Andrew was talking about rows anyway, though. And, for columns you can use NPC Code: |
Quote:
|
Quote:
In SQLite if you want to drop a column you should create a backup table. If you want to drop column b in a table named spelling that has columns a, b, c, you would do: BEGIN CREATE TABLE spelling_bak AS SELECT a, c FROM spelling DROP TABLE spelling CREATE TABLE spelling AS SELECT * FROM spelling_bak COMMIT |
Quote:
I've never actually done it myself. |
| All times are GMT +2. The time now is 02:33 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.