List:General Discussion« Previous MessageNext Message »
From:kayamboo Date:December 6 2002 6:31am
Subject:alter table syntax
View as plain text  
sql, mysql, query

Hello folks

This is my table structure with MySql 4.0.3-beta-max-nt with InnoDB

+---------+------------------+------+-----+---------+-------+
| Field   | Type             | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+-------+
| town    | varchar(50)      |      | PRI |         |       |
| subcity | varchar(50)      |      | MUL |         |       |
| rankt   | int(10) unsigned |      |     | 0       |       |
+---------+------------------+------+-----+---------+-------+
3 rows in set (0.01 sec)

Now I want to have the primary key on both town and subcity fields like this

mysql> describe town_db1 ;
+---------+------------------+------+-----+---------+-------+
| Field   | Type             | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+-------+
| town    | varchar(50)      |      | PRI |         |       |
| subcity | varchar(50)      |      | PRI |         |       |
| rankt   | int(10) unsigned |      |     | 0       |       |
+---------+------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

I am able to create new table but can't alter the existing one to achieve
this.


Any suggestions with alter syntax is highly appreciated

Thanks for your time

Regards


Thread
alter table syntaxkayamboo6 Dec
  • Re: alter table syntaxR. Hannes Niedner6 Dec
    • Re: alter table syntaxkayamboo6 Dec
      • re: Re: alter table syntaxEgor Egorov6 Dec
      • Re: alter table syntaxDan Nelson6 Dec
    • Re: alter table syntaxkayamboo9 Dec
      • Re: alter table syntaxDan Nelson9 Dec
    • Re: Re: alter table syntaxkayamboo9 Dec
    • Re: alter table syntaxListen Hinz9 Dec