SQL:SELECT *, (+(CASE WHEN cloud LIKE '%sale%' THEN 1 ELSE 0 END)+(CASE WHEN cloud LIKE '%heraklion%' THEN 1 ELSE 0 END)) AS relevance FROM properties WHERE AND (cloud LIKE '%sale%') AND (cloud LIKE '%heraklion%') AND munic LIKE 'for sale heraklion%' AND cloud LIKE '% %' ORDER BY pid DESC
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND (cloud LIKE '%sale%') AND (cloud LIKE '%heraklion%') AND munic LIKE 'for sal' at line 1