sivanath.nagendran Posted December 14, 2006 Share Posted December 14, 2006 Hi I am newbie to SQL queries and aso database field. I need one help, how to assign to one variable as a Unique key?Pls anyone can help to this. Explain me more brieflyAdvance thanks for your concentration.BySivanath.N Link to comment Share on other sites More sharing options...
aspnetguy Posted December 14, 2006 Share Posted December 14, 2006 what database are you using? Link to comment Share on other sites More sharing options...
sivanath.nagendran Posted December 14, 2006 Author Share Posted December 14, 2006 I am using MySQL database. Link to comment Share on other sites More sharing options...
aspnetguy Posted December 14, 2006 Share Posted December 14, 2006 here are all the options when creating a column olumn_definition: col_name data_type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY] [COMMENT 'string'] [reference_definition] Link to comment Share on other sites More sharing options...
justsomeguy Posted December 14, 2006 Share Posted December 14, 2006 You need to define the column as a primary key, and give it the auto_increment option. The datatype needs to be an integer. If you are using something like phpMyAdmin to set up the database then you can do it graphically, or else you need to write the SQL to do it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now