Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases General > Re: Conditional...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 3143 of 3295
Post > Topic >>

Re: Conditional unique constraint.

by Lennart <Erik.Lennart.Jonsson@[EMAIL PROTECTED] > Apr 18, 2008 at 11:54 AM

On Apr 18, 8:27 pm, "Stuck&Cold" <stuck.and.c...@[EMAIL PROTECTED]
> wrote:
> Hi guys;
>
> I have a hierarchical structure represented in a database with child
> nodes having a foreign key to their parent. I'm wondering how to
> create a constraint on uniqueness of a "name" attribute on that
> entity, but the uniqueness should only be between siblings. In other
> words, duplicate names are allowed as long as the instances don't
> share the same parent.
>
> Could someone in the know point me in the right direction?
>
> Thanks in advance.

I think you are close to a solution. Think about it, what information
does two siblings share? That together with the name should be
unique.

HTH
/Lennart
 




 3 Posts in Topic:
Conditional unique constraint.
"Stuck&Cold"  2008-04-18 11:27:32 
Re: Conditional unique constraint.
"Stuck&Cold"  2008-04-18 11:39:50 
Re: Conditional unique constraint.
Lennart <Erik.Lennart.  2008-04-18 11:54:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 9:31:33 CST 2008.