ALTER TABLE town_db1 DROP PRIMARY KEY; ALTER TABLE town_db1 ADD PRIMARY KEY(town, subcity );
On 12/5/02 10:31 PM, "kayamboo" <[EMAIL PROTECTED]> wrote: > 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 > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail > <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php