Thread: SQL deleting
View Single Post
  #4  
Old 05-12-2009, 09:38 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by napo_p2p View Post
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
What?

NPC Code:

DELETE FROM table_name WHERE var = 'val'



e.g.

NPC Code:

DELETE FROM jailed WHERE account = 'cbk1994'



EDIT: Sorry, I misread; I think that Andrew was talking about rows anyway, though.

And, for columns you can use

NPC Code:

ALTER TABLE table_name
DROP COLUMN column

__________________
Reply With Quote