Unique key
-
hi, I have a table with persons having a integer as a unique key. now i've made a second table groups defined by the persons in it. the combination of the uniek keys of the persons should be my unique key in the groups table. for example 1. person a 2. person b 3. person c first group is 1,2 second group is 1,3 third group is 2,3 fourth group is 1,2,3 Does anyone has any idea how i can store this data easely as unique key and still find the related data in an easy way ? Data delivered to search a group are the combinations of the persons. greetz and thx Kurt
-
hi, I have a table with persons having a integer as a unique key. now i've made a second table groups defined by the persons in it. the combination of the uniek keys of the persons should be my unique key in the groups table. for example 1. person a 2. person b 3. person c first group is 1,2 second group is 1,3 third group is 2,3 fourth group is 1,2,3 Does anyone has any idea how i can store this data easely as unique key and still find the related data in an easy way ? Data delivered to search a group are the combinations of the persons. greetz and thx Kurt
I'm not sure I follow you, but shouldn't you have a table of Groups
1. Group1
2. Group2
3. Group3Then a table to represent the many-to-many relationships
Person Group
1 1
1 2
1 4
2 1
2 3
2 4
3 2
3 3
3 4 -
I'm not sure I follow you, but shouldn't you have a table of Groups
1. Group1
2. Group2
3. Group3Then a table to represent the many-to-many relationships
Person Group
1 1
1 2
1 4
2 1
2 3
2 4
3 2
3 3
3 4thx for the response, but i'm not quite sure. if i deliver you person 2 and 3 can you give me the group the present ? i gues i need a select where group is the same for person 2 and 3 and where group is not used by other persons or so.. hmm this might work... Problem is that i get a bunch of persons and update common data as group, i'll need to check if the group exists if not i'll add the common data else i'll update the common data of those persons. so i didn't think about a cross table.. good thinking... thx just thinking now that i need to insert multiple keys in de many-to-many table when adding one record for a group, but that should not be a problem.
-
hi, I have a table with persons having a integer as a unique key. now i've made a second table groups defined by the persons in it. the combination of the uniek keys of the persons should be my unique key in the groups table. for example 1. person a 2. person b 3. person c first group is 1,2 second group is 1,3 third group is 2,3 fourth group is 1,2,3 Does anyone has any idea how i can store this data easely as unique key and still find the related data in an easy way ? Data delivered to search a group are the combinations of the persons. greetz and thx Kurt
listen, i don´t understand what you want to do. what about the groups stuff? name then to understand, maybe anyone could help you. do you have 5 tables? persons,group1?,group2?,group3?,group4? :omg:
nelsonpaixao@yahoo.com.br trying to help & get help