Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Database/World Building

Archive::Database/World Building Archive area for General Discussion's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2003, 05:58 PM
Kolo
Hill Giant
 
Join Date: Jul 2002
Location: Chicago Suburb
Posts: 103
Default Quick MYSQL question...

How would you phrase a CREATE statement to state the following...

I have 2 columns, each column can have duplicate values, but no rows can have both duplicated...hrm..example:
| I1| I2| Data
| 1 | 2 | Data
| 1 | 3 | Data
| 2 | 2 | Data
| 3 | 1 | Data
| 3 | 2 | Data

but I could not add (1 | 3) again. I1 and I2 are the keys in this example. I've been searching the internet for a response to this but keep coming up with syntax formats and whatnot. I would prefer a plain english response

Thanks in advance...
Reply With Quote
  #2  
Old 09-04-2003, 06:14 PM
Kolo
Hill Giant
 
Join Date: Jul 2002
Location: Chicago Suburb
Posts: 103
Default

I think I might have gotten it, but I want to be sure this is the correct method of doing this :/

CREATE TABLE `blah` (
`ID_1` int(11) unsigned NOT NULL default '0',
`ID_2` int(11) unsigned NOT NULL default '0',
`data` varchar(50) NOT NULL default '',
PRIMARY KEY (`ID_1`,`ID_2`),
UNIQUE KEY `Unique` (`ID_1`,`ID_2`)
);

Again, if you can provide me insight on this, Thanks!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:37 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3