I need some help with Mariadb doing a left join on multiple fields. I have an info table with information about locations and it is linked to a vendor table. The telcom vendor table contains an id key field and all the vendors. The main table has info for multiple fields that look up to the vendor table (Data vendor, Voice vendor, Video vendor).
select s.storenum, s.address, s.city, s.state, s.zip, s.phone, s.county, t.telcom as phoneprovider, s.phoneacctnum, t.telcom as dataprovider, s.dataacctnum from StoreInfo s left join Telcom t on s.telcomphone = t.telcomkey and s.telcomdata = t.telcomkey
This works fine if I only look up a SINGLE telcom vendor, but when I try to lookup each one I get nothing back. How do I do this?
For example vendor table
1 Spectrum
2 AT&T
3 DirecTV