Hello, SQL 2008R2
I have two tables with a one to many relationship. Table B will have several group types say Alpha, Beta, Gamma,... for each record in table A. I want to add groups that are not there but only one at a time as the group is used to control another process. Currently this is done with several queries. Is that the best way?
Example:
[tt]R1 Alpha
R1 Beta
R1 Gamma
R2 Alpha
R3 Beta[/tt]
So in this case we would want to add R1 Delta, R2 Beta, and R3 Alpha. There is criteria that goes along with each group type that I though could be used in a CASE statement. What stoped me was two of the criteria were the same, say for Beta and Delta.
Can someone point me in the direction I should be going.
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
I have two tables with a one to many relationship. Table B will have several group types say Alpha, Beta, Gamma,... for each record in table A. I want to add groups that are not there but only one at a time as the group is used to control another process. Currently this is done with several queries. Is that the best way?
Example:
[tt]R1 Alpha
R1 Beta
R1 Gamma
R2 Alpha
R3 Beta[/tt]
So in this case we would want to add R1 Delta, R2 Beta, and R3 Alpha. There is criteria that goes along with each group type that I though could be used in a CASE statement. What stoped me was two of the criteria were the same, say for Beta and Delta.
Can someone point me in the direction I should be going.
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!