Difference between revisions of "ALTER TABLE ... DROP COLUMN"

From SQLZOO
Jump to: navigation, search
 
Line 12: Line 12:
 
</source>
 
</source>
  
<source lang='sql' class='def'>ALTER TABLE a DROP COLUMN y
+
<source lang='sql' class='def'>ALTER TABLE a DROP COLUMN y;
 +
SELECT * FROM a;
 
</source>
 
</source>
<source lang='sql' class='def e-sybase'>ALTER TABLE a DROP y
+
<source lang='sql' class='def e-sybase'>ALTER TABLE a DROP y;
 +
SELECT * FROM a;
 
</source>
 
</source>
  

Latest revision as of 15:04, 17 July 2012

Delete a column from a table

schema:scott

This is in the SQL standard ALTER TABLE

DROP TABLE a
CREATE TABLE a(x INTEGER, y INTEGER);
INSERT INTO a VALUES (1,2);
ALTER TABLE a DROP COLUMN y;
SELECT * FROM a;
ALTER TABLE a DROP y;
SELECT * FROM a;
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense