I have a table called monitor_links with the following columns:
This table is used to store links from others websites. I'm getting those links using this query:
SELECT title, url
FROM monitor_links
WHERE id_domain = 5
GROUP BY url
ORDER BY date_created asc
With that query I return the title and url from the storage link (where id_domain is equal to 5). But in my case, can exists rows with same url, and to not return same repeated url I'm using GROUP BY url. (If exists more than one row with same URL and id_domain = 5, my code returns only one of this rows).
The problem is that I'm getting the following error:
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'shuri.monitor_links.title' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by'.
Some people said that I can try to disable the only_full_group_by, but I want to fix my query rather than silencing the warning.
