SQL columns

  • Thread starter ponjavic
  • Start date
  • #1
225
0
Isn't possible to delete and remove columns after a table has been created?
Rows works just fine but columns don't...
 

Answers and Replies

  • #2
345
3
in MySQL, this is done with http://dev.mysql.com/doc/mysql/en/ALTER_TABLE.html [Broken]
 
Last edited by a moderator:
  • #3
591
0
Note that columns and rows in a database are very different things, so the fact that you can do something to a row doesn't automatically mean you should be able to do the same thing to a column.


Still, any good database should allow you to delete a column unless you've deliberately added constraints that would prevent it. But you have to modify the table to do that, usually with an ALTER TABLE statement.
 
  • #4
294
0
You can, but its not considered a good thing to do, except possibly when prototyping. This is because you are altering your schema, which shouldn't happen. Would you want to alter the form of a data structure at runtime?
 
  • #5
591
0
so-crates said:
You can, but its not considered a good thing to do, except possibly when prototyping. This is because you are altering your schema, which shouldn't happen. Would you want to alter the form of a data structure at runtime?

If your schema is wrong, why wouldn't you change it?
 
  • #6
176
0
It is a DDL command and is language specific.
 

Related Threads on SQL columns

  • Last Post
Replies
12
Views
1K
Replies
5
Views
2K
Replies
1
Views
807
Replies
8
Views
1K
  • Last Post
Replies
5
Views
2K
Replies
8
Views
2K
  • Last Post
Replies
2
Views
1K
Replies
6
Views
1K
  • Last Post
Replies
8
Views
1K
Replies
31
Views
2K
Top