Hello,
I have this query, and in short I need to take all of the oaks, and combine them into 1 count. If take out the join, and just use inv_machine it works. If I leave it as is, and just search for one of the oaks it works, but when I try more than one it sits there a while and times out.
I have this query, and in short I need to take all of the oaks, and combine them into 1 count. If take out the join, and just use inv_machine it works. If I leave it as is, and just search for one of the oaks it works, but when I try more than one it sits there a while and times out.
Code:
Select count(*) As Machine FROM machinehistory_scan INNER JOIN inv_machine ON machinehistory_scan.id = inv_machine.id AND inv_machine.location = 'Oaks IDF1 - 1st' OR inv_machine.location = 'Oaks IDF2 - 1st' OR inv_machine.location = 'Oaks IDF3 - 2nd' OR inv_machine.location = 'Oaks IDF4 - 2nd' OR inv_machine.location = 'Oaks IDF5 - 2nd' OR inv_machine.location = 'Oaks IDF6 - 3rd'