So I have four tables. Each table has a single id for the previous table id. So my in click table has an id and an id for the ad from which it came. In the ad table, it has
Inner joins are probably the best method, and you only need 3.
This will give you a result set with two columns: company and associated values.
SELECT Table4.company, table1.id, table1.value
FROM Table1
INNER JOIN Table2
ON Table2.table1_id = Table1.id
INNER JOIN Table3
ON Table3.table2_id = Table2.id
INNER JOIN Table4
ON Table4.table3_id = Table3.id