You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'range FROM a1_master.prodattrib WHERE name="range") AS attrib_range ON prod.stoc' at line 1