» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 05-06-2007, 05:48 AM
phiona phiona is offline
Junior Member
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
phiona is on a distinguished road
Default duplicate issue?

hello all,
My table stores a serial and the status with ID as the primary key which I set. My problem is like this
ID Serial Status
1 12345 b
2 12345 b
3 12345 b
4 12345 b
5 12345 y

What I want to enable is that any time the combination of serial & status as 'b' can be duplicate and serial and status 'y' cannot be duplicate only one. So, how to enforce this integrity in my database? Please help me guys.
Thankz. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 05-06-2007, 07:23 AM
inder inder is offline
Senior Member
 
Join Date: Sep 2006
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 16
inder is on a distinguished road
Default Re: duplicate issue?

Instead of having a table serial_status(id,serial,status), split the table so that you have two tables serial_status_b(id,serial) and serial_status_y(id,serial). If the (id,serial) need to be unique, make a third table referenced by these two by a foreign key constraint.
Hope it will help you. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate Content / Indexing - DeIndexing and Rankings waqar Google 7 06-07-2007 09:08 AM
Mysql_fetch_array issue, parsing most likely the issue cisco PHP Programming and Tips 1 08-28-2006 01:44 PM
DMOZ duplicate content sibanda Directories 1 08-03-2006 03:26 PM
Does Yahoo and MSN ban websites with duplicate content qwerty Yahoo 3 07-24-2006 01:50 PM
Duplicate Content Penalization domdom Google 1 07-03-2006 12:56 PM


All times are GMT. The time now is 02:54 AM.