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 RELCAT.cd_categ=1 AND RELTEM.cd_tema=3 GROUP BY A.cd_pk' at line 5You 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 RELCAT.cd_categ=1 AND RELTEM.cd_tema=3
GROUP BY A.cd_pk
ORDER BY cd_or' at line 12