Hi, I am a beginner SQL user and am trying to take table 1 (contracts) and pull in the calltype from table2 (equipment) with the control number as the common field.
However, there are duplicate control numbers in table2 which are causing me an issue.
I have created this query on table 2 to get the data I want to combine with table1:
Select DISTINCT calltype, controlnumber
WHERE CALLTYPE IS NOT NULL
I want to join or what ever is the best way the data results from the query above to my table1 to pull in the calltype field into my table1.
I've read about inner joins, outer join, left, right, unions and I just can't seem to get it to do what I want.
Control Customer Sales
Number Number Rep
15837 ABC Sam
16268 DEF Jen
16269 GHI Beckey
16270 JKL John
16279 MNO Mary
Control Call Customer Sales
Number Type Number Rep
15837 2 ABC Sam
16268 1 DEF Jen
16269 2 GHI Beckey
16270 3 JKL John
16279 2 MNO Mary
Thanks in advance for any help you can provide.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!