вот я и прошу выведи схематику таблиц, т.к. что откуда весьма не понятно
Ок, давайте без связанной таблицы. Мне нужно получить все записи в таблице visitors где поле hash уникальный. А там где один и тот же хэш вернуть первую строчку
Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mydb.visitors.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from visitors group by hash)
Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mydb.visitors.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from visitors group by hash)
Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mydb.visitors.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select * from visitors group by hash)
ты группируешь по hash, но у тебя с одинаковым хэшем есть более 1 записи, какой визиторс id ему показать из этих двух в выборке?
он ругается т.к. в select есть поля отличные от поля указанного в group by и образуется не одначначность на выдаче, т.е. какое занчение из группировки вренуть