I have two tables that I need to join but when I try to run the SQL script it is timing out.
Table one is called ObjectRating Table two is Product
Table one contains a column called ObjectID table two as a column called ID which is the same as Object ID. So that is the joining value.
Table two also contains column Name that I want.
So how can I write a SQL script to get this information? My thoughts were
m.Name as 'BRAND'
FROM StarProduct p
INNER JOIN StarObjectToGroup otg on otg.ObjectID = p.ID
INNER JOIN KicksObjectRating kor on kor.ObjectID = p.ID
INNER JOIN StarManufacturer m on m.ID = p.ManufacturerID
LEFT JOIN StarGroup g on g.ID = otg.GroupID
and kor.CreatedAt between '2016-02-19' and '2016-03-11'
order by kor.CreatedAt