1. Home
  2. Computing & Technology
  3. PHP / MySQL

Add Unique - MySQL Command

By , About.com Guide

Definition: When you are altering a table to add in another colum you can use Add Unique. This will add in a new column, and make sure that it's not a duplicate of any of the already existing columns. It is written as: alter table your_table add unique (column_name)
Also Known As: Add Unique Column
Examples:
alter table people add unique (eye_color)
This code would add a new column, eye_color, to the table called people - if that column didn't already exist.
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. MySQL Commands
  5. SQL Add Unique - Add Unique Table Column MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.