Sorry for all the questions guys! I'm a SQL newb...
I have 2 tables I'm trying to join:
traits
trait_num trait_name trait_value
1 color blue
2 color red
3 color green
4 size small
5 size medium
6 size large
7 buttons round
8 buttons square
9 buttons oval
products_to_traits
product_num trait_num
1 1
1 4
1 7
2 1
2 6
2 8
3 3
3 5
3 7
for example, with an simple join on trait_num, product #1 would return the following product characteristics for me:
traits_name traits_value
color blue
size small
buttons round
here's my problem...
how do i create a SQL statement that will show me the available trait_name's and trait_value's if i'm given a set of trait_num's, yet exclude the trait_name's that have already been selected?
For example, given trait_num 7 (trait_name = "buttons" and trait_value = "round"), there are two products that have this characteristic (product_num 1, and product_num 3). I want a list all of these product's trait_num's excluding and trait_nums that have the trait_name = "buttons. So, I want as a result:
trait_num
1
4
3
5
Does this make sense?
Thanks in advance for all your help!!!
Jeff
I have 2 tables I'm trying to join:
traits
trait_num trait_name trait_value
1 color blue
2 color red
3 color green
4 size small
5 size medium
6 size large
7 buttons round
8 buttons square
9 buttons oval
products_to_traits
product_num trait_num
1 1
1 4
1 7
2 1
2 6
2 8
3 3
3 5
3 7
for example, with an simple join on trait_num, product #1 would return the following product characteristics for me:
traits_name traits_value
color blue
size small
buttons round
here's my problem...
how do i create a SQL statement that will show me the available trait_name's and trait_value's if i'm given a set of trait_num's, yet exclude the trait_name's that have already been selected?
For example, given trait_num 7 (trait_name = "buttons" and trait_value = "round"), there are two products that have this characteristic (product_num 1, and product_num 3). I want a list all of these product's trait_num's excluding and trait_nums that have the trait_name = "buttons. So, I want as a result:
trait_num
1
4
3
5
Does this make sense?
Thanks in advance for all your help!!!
Jeff