You need to make Join
two tables (one-to-many relationship). Everything is fine here, but I have 2 entries for one domain.
In principle, also not difficult
GROUP BY `name`
But
As you can see after the grouping, he left the first value, but I need to leave the last, and best of all there is a date
field to leave on it, which has the most recent
SELECT `domain`.`id` AS `id`, `domain`.`dns_a` AS `dns_a`, `domain`.`name` AS `name`, `domain_info`.`keywords` AS `keywords`, `domain_info`.`keywords_dynamic` AS `keywords_dynamic`, `domain_info`.`date` AS `date`, `domain_info`.`se` AS `se`, `domain`.`published` AS `published` FROM ( domain LEFT OUTER JOIN `domain_info` ON ( ( domain.id = `domain_info`.domain_id ) ) ) GROUP BY `name`
I tried through WHERE
and HAVING
- it turned out, but then it does not leave those lines in which there is a domain, but there are still no statistics.