- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: simple question...mysql+unique
Operating System - HP-UX
1753882
Members
7626
Online
108809
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2006 10:20 PM
тАО07-09-2006 10:20 PM
simple question...mysql+unique
Helooo,
I have table like this:
CREATE TABLE `actions` (
`id` INT NOT NULL AUTO_INCREMENT ,
`date` INT NOT NULL ,
`time` INT NOT NULL ,
`comp` VARCHAR( 10 ) NOT NULL ,
`target` VARCHAR( 20 ) NOT NULL ,
`action` VARCHAR( 100 ) NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE (`id`)
);
Also I have some data in that table but unique field is just id..I have some duplicated data there and I would like to have table like this:
CREATE TABLE `actions` (
`id` INT NOT NULL AUTO_INCREMENT ,
`date` INT NOT NULL ,
`time` INT NOT NULL ,
`comp` VARCHAR( 10 ) NOT NULL ,
`target` VARCHAR( 20 ) NOT NULL ,
`action` VARCHAR( 100 ) NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE (`id`) ,
UNIQUE (`time`)
);
so in this case it would not allow insert records with a same time value..
is there a way other then to drop and create again table and new insert..??
any ideas??
I have table like this:
CREATE TABLE `actions` (
`id` INT NOT NULL AUTO_INCREMENT ,
`date` INT NOT NULL ,
`time` INT NOT NULL ,
`comp` VARCHAR( 10 ) NOT NULL ,
`target` VARCHAR( 20 ) NOT NULL ,
`action` VARCHAR( 100 ) NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE (`id`)
);
Also I have some data in that table but unique field is just id..I have some duplicated data there and I would like to have table like this:
CREATE TABLE `actions` (
`id` INT NOT NULL AUTO_INCREMENT ,
`date` INT NOT NULL ,
`time` INT NOT NULL ,
`comp` VARCHAR( 10 ) NOT NULL ,
`target` VARCHAR( 20 ) NOT NULL ,
`action` VARCHAR( 100 ) NOT NULL ,
PRIMARY KEY ( `id` ) ,
UNIQUE (`id`) ,
UNIQUE (`time`)
);
so in this case it would not allow insert records with a same time value..
is there a way other then to drop and create again table and new insert..??
any ideas??
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2006 10:55 PM
тАО07-09-2006 10:55 PM
Re: simple question...mysql+unique
Hi,
have you tried:
alter table actions drop primary key;
alter table actions add primary key unique id, unique time;
have you tried:
alter table actions drop primary key;
alter table actions add primary key unique id, unique time;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2006 11:33 PM
тАО07-09-2006 11:33 PM
Re: simple question...mysql+unique
welll firs command passed but second did not...
any ideas????
any ideas????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2006 11:47 PM
тАО07-09-2006 11:47 PM
Re: simple question...mysql+unique
O well I dropped table and I created it again and insert data in it..
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP