Delete a column in database

Hello. I want to delete a column because I set a wrong thing when I was creating it, I made it accept integer when I realized it should be text. When I execute the command listed down I get an error. How can I fix that?

ALTER COLUMN list_of_vietnamese_restaurant DROP COLUMN timeofopen;

Error:
Result: near “COLUMN”: syntax error

In line 1:

ALTER COLUMN

Hi, welcome to the forums.

Is this sqlite or postgres? Do you mean drop a column from a table?

You need to tweak ALTER

See this:
https://www.sqlitetutorial.net/sqlite-alter-table/

Or, this:
https://www.postgresqltutorial.com/postgresql-drop-column/

1 Like

It’s a sqlite. Yes I mean to drop a column from a table

double check the first link and your syntax for ALTER.

1 Like

I fixed it by making a temporary table, importing data there, dropping the wrong table, creating the okay, importing data there and dropping temporary. Thanks for help