# 1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'tbdepartamentos.id_departamentos' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

SELECT tbdepartamentos.*, tbdepartamentos_categorias.* FROM (SELECT * FROM tbdepartamentos ORDER BY data DESC) as tbdepartamentos INNER JOIN tbdepartamentos_categorias ON (tbdepartamentos.id_categoria = tbdepartamentos_categorias.id_categoria) GROUP BY tbdepartamentos.id_categoria ORDER BY tbdepartamentos.data DESC LIMIT 6;