A
arvintheoc
I have 2 tables, t1 and t2.
t1 has 2 columns, t1col1 and t1col2.
t1col1 is a list of names while t1col2 has numbers. For example:
t1col1,t1col2
john smith,22
warren hastings,33
andrew thomas starr,44
warren scott,10
Note: each entry in t1col1 has any number of words separated by spaces
t2 has only 1 col, t2col1, which is a list single word entries. For example:
t2col1
warren
jason
narita
john
I want to compare t2 with t1: Each time an entry in t2 appears in col1 of
t1, I want it to count, and sum the values in t1 col2.
For example, the result in this case would be:
Result:
t2col1, count, sum_of_t1col2
warren,2,43
jason,0,0
narita,0,0
john,1,22
AS you can see, warren appears twice in t1 and the corresponding col2
entries are added.
How do I do this?
Thanks.
t1 has 2 columns, t1col1 and t1col2.
t1col1 is a list of names while t1col2 has numbers. For example:
t1col1,t1col2
john smith,22
warren hastings,33
andrew thomas starr,44
warren scott,10
Note: each entry in t1col1 has any number of words separated by spaces
t2 has only 1 col, t2col1, which is a list single word entries. For example:
t2col1
warren
jason
narita
john
I want to compare t2 with t1: Each time an entry in t2 appears in col1 of
t1, I want it to count, and sum the values in t1 col2.
For example, the result in this case would be:
Result:
t2col1, count, sum_of_t1col2
warren,2,43
jason,0,0
narita,0,0
john,1,22
AS you can see, warren appears twice in t1 and the corresponding col2
entries are added.
How do I do this?
Thanks.