Can't execute query: 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 'ORDER BY ID_CISN_HABITATY DESC' at line 1
SELECT CISN_HABITATY.OWNER AS MAINOWNER, CISN_HABITATY.ID_CISN_HABITATY, OSOBY_OWNER.PRIJMENI AS OWNER_PRIJMENI, OSOBY_OWNER.JMENO AS OWNER_JMENO, OSOBY_OWNER.TITULY_PREDJM AS OWNER_TITULY_PREDJM, OSOBY_OWNER.TITULY_ZAJM AS OWNER_TITULY_ZAJM, OSOBY_UPDATOR.PRIJMENI AS UPDATOR_PRIJMENI, OSOBY_UPDATOR.JMENO AS UPDATOR_JMENO, OSOBY_UPDATOR.TITULY_PREDJM AS UPDATOR_TITULY_PREDJM, OSOBY_UPDATOR.TITULY_ZAJM AS UPDATOR_TITULY_ZAJM, CISN_HABITATY.DATI_INSERT, CISN_HABITATY.DATI_UPDATE, CISN_HABITATY.XX_Habitat, CISN_HABITATY.HABITATKOD, CISN_HABITATY.HABITATNAZEV_CZ, CISN_HABITATY.HABITATNAZEV_HTML_CZ, CISN_HABITATY.HABITATNAZEV_EN, CISN_HABITATY.HABITATNAZEV_HTML_EN, CISN_HABITATY.IDX_CISN_TRIDY_HAB, CISN_TRIDY_HAB_IDX_CISN_TRIDY_HAB.TRIDAKOD AS IDX_CISN_TRIDY_HAB_TRIDAKOD , CISN_TRIDY_HAB_IDX_CISN_TRIDY_HAB.TRIDAHAB_NAZ_CZ AS IDX_CISN_TRIDY_HAB_TRIDAHAB_NAZ_CZ, CISN_HABITATY.POPIS_CZ, CISN_HABITATY.POPIS_EN, CISN_HABITATY.PRIORITA, CISN_HABITATY.ZAKLY_MONITORINGU_CZ, CISN_HABITATY.ZAKLY_MONITORINGU_EN, CISN_HABITATY.IDX_FILES, FILES_IDX_FILES.FILENAME AS IDX_FILES_FILENAME, CISN_HABITATY.POPIS_MAPKY_CZ, CISN_HABITATY.POPIS_MAPKY_EN FROM CISN_HABITATY, OSOBY AS OSOBY_OWNER , OSOBY AS OSOBY_UPDATOR , CISN_TRIDY_HAB AS CISN_TRIDY_HAB_IDX_CISN_TRIDY_HAB , FILES AS FILES_IDX_FILES WHERE 1 AND HABITATKOD <> 'x' AND HABITATKOD <> 'y' AND HABITATKOD <> 'z' AND HABITATKOD <> 'o' AND CISN_HABITATY.OWNER = OSOBY_OWNER.ID_OSOBY AND CISN_HABITATY.UPDATOR = OSOBY_UPDATOR.ID_OSOBY AND CISN_HABITATY.IDX_CISN_TRIDY_HAB = CISN_TRIDY_HAB_IDX_CISN_TRIDY_HAB.ID_CISN_TRIDY_HAB AND CISN_HABITATY.IDX_FILES = FILES_IDX_FILES.ID_FILES ORDER BY ORDER BY ID_CISN_HABITATY DESC