Database Error

Error message returned from the database:

Could not execute query [Native Error: 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 ') AND OtherItem.productID not in () AND Product.isEnabled=1 GROUP BY Ot' at line 12] [User Info: SELECT COUNT(*) AS cnt, COALESCE(ParentProduct.ID, OtherItem.productID) AS ID FROM OrderedItem LEFT JOIN CustomerOrder ON OrderedItem.customerOrderID=CustomerOrder.ID LEFT JOIN OrderedItem AS OtherItem ON OtherItem.customerOrderID=CustomerOrder.ID LEFT JOIN Product ON OtherItem.productID=Product.ID LEFT JOIN Product AS ParentProduct ON Product.parentID=ParentProduct.ID WHERE CustomerOrder.isFinalized=1 AND OrderedItem.productID in () AND OtherItem.productID not in () AND Product.isEnabled=1 GROUP BY OtherItem.productID ORDER BY cnt DESC LIMIT 5]