The systems produces:
Your SQL query ( FOR debugging purpose) :
SELECT
`activity`.`id`,
`activity`.`contact_id`,
`contact____1`.`givenName` AS `contact____givenName____1`,
`contact____1`.`middleName` AS `contact____middleName____1`,
`contact____1`.`surName` AS `contact____surName____1`,
`activity`.`project_id`,
`activity`.`date`,
`activity`.`start_time`,
`activity`.`end_time`,
`activity`.`type_id`,
`KeywordCategoryOverview____1`.`description` AS `KeywordCategoryOverview____description____1`,
`activity`.`action`,
`activity`.`discipline_id`,
`KeywordCategoryOverview____2`.`description` AS `KeywordCategoryOverview____description____2`,
`activity`.`status_id`,
`KeywordCategoryOverview____3`.`description` AS `KeywordCategoryOverview____description____3`,
`activity`.`location_id`,
`activity`.`location_id_from`,
`activity`.`location_id_to`,
`activity`.`distance`,
`activity`.`create_timestamp`,
`activity`.`update_timestamp`
FROM
`activity`
LEFT JOIN `contact` AS `contact____1` ON `activity`.`contact_id` = `contact____1`.`contact_id`
LEFT JOIN `KeywordCategoryOverview` AS `KeywordCategoryOverview____1` ON `activity`.`type_id` = `KeywordCategoryOverview____1`.`Keyword_id`
LEFT JOIN `KeywordCategoryOverview` AS `KeywordCategoryOverview____2` ON `activity`.`discipline_id` = `KeywordCategoryOverview____2`.`Keyword_id`
LEFT JOIN `KeywordCategoryOverview` AS `KeywordCategoryOverview____3` ON `activity`.`status_id` = `KeywordCategoryOverview____3`.`Keyword_id`
ORDER BY
`activity`.`date` ASC,
`activity`.`id`
But it should be:
SELECT
`activity`.`id`,
`activity`.`contact_id`,
`contact____1`.`givenName` AS `contact____givenName____1`,
`contact____1`.`middleName` AS `contact____middleName____1`,
`contact____1`.`surName` AS `contact____surName____1`,
`activity`.`project_id`,
`activity`.`date`,
`activity`.`start_time`,
`activity`.`end_time`,
`activity`.`type_id`,
`KeywordCategoryOverview____1`.`description` AS `KeywordCategoryOverview____description____1`,
`activity`.`action`,
`activity`.`discipline_id`,
`KeywordCategoryOverview____2`.`description` AS `KeywordCategoryOverview____description____2`,
`activity`.`status_id`,
`KeywordCategoryOverview____3`.`description` AS `KeywordCategoryOverview____description____3`,
`activity`.`location_id`,
`activity`.`location_id_from`,
`activity`.`location_id_to`,
`activity`.`distance`,
`activity`.`create_timestamp`,
`activity`.`update_timestamp`
FROM
`activity`
LEFT JOIN `contact` AS `contact____1` ON `activity`.`contact_id` = `contact____1`.`contact_id`
LEFT JOIN `KeywordCategoryOverview` AS `KeywordCategoryOverview____1` ON `activity`.`type_id` = `KeywordCategoryOverview____1`.`Keyword_id` AND `KeywordCategoryOverview____1`.`language_id` = '1' AND `KeywordCategoryOverview____1`.`tabel` = 'activity' AND `KeywordCategoryOverview____1`.`table_field` = 'type_id'
LEFT JOIN `KeywordCategoryOverview` AS `KeywordCategoryOverview____2` ON `activity`.`discipline_id` = `KeywordCategoryOverview____2`.`Keyword_id` AND `KeywordCategoryOverview____2`.`language_id` = '1' AND `KeywordCategoryOverview____2`.`tabel` = 'activity' AND `KeywordCategoryOverview____2`.`table_field` = 'discipline_id'
LEFT JOIN `KeywordCategoryOverview` AS `KeywordCategoryOverview____3` ON `activity`.`status_id` = `KeywordCategoryOverview____3`.`Keyword_id` AND `KeywordCategoryOverview____3`.`language_id` = '1' AND `KeywordCategoryOverview____3`.`tabel` = 'activity' AND `KeywordCategoryOverview____3`.`table_field` = 'status_id'
ORDER BY
`activity`.`date` ASC,
`activity`.`id`