SQL is the language used to query and manipulate relational databases. The most common types of SQL statement are:
This message is telling us that a SQL statement was submitted to the database server, typically MySQL, and the database server responded by informing us the the statement was incorrectly formatted.
The most common cause for this error message is a simple typo, for example a miss-spelled field name.
Another cause that we see often is where the SQL statement contains the "IN()" opearator, for example to supply a list of node IDs to filter on, but where the PHP code does not first sanity check that there are actually some values to pass to the "IN()" operator, resulting in a malformed SQL statement.
Start by getting the actual SQL that hits the database and then look carefully for typos. If nothing seems obvious, start breaking the SQL statement down and executing the simplified statements directly, either with a GUI or CLI, and this should help you home in on exactly where the problem lies.