Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.0.10, 10.0.12
-
None
-
Ubuntu 14.04
10.0.12-MariaDB-1~trusty-log - mariadb.org binary distribution
Description
I am using two tables joined together. If I use DISTINCT everything is OK, but I need unique rows. Using GROUP BY returns NULL. In old mysql 5.5 everything works fine.
Query 1 bad results:
SELECT items_6 . * , cm1.brand AS brand1, cm2.model AS model1 |
FROM items_6 |
LEFT JOIN cars_models AS cm1 ON cm1.brandid = items_6.brand |
LEFT JOIN cars_models AS cm2 ON cm2.id = items_6.model |
GROUP BY items_6.id |
Query 2 - good results, but not unique by items_6.id
SELECT DISTINCT items_6 . * , cm1.brand AS brand1, cm2.model AS model1 |
FROM items_6 |
LEFT JOIN cars_models AS cm1 ON cm1.brandid = items_6.brand |
LEFT JOIN cars_models AS cm2 ON cm2.id = items_6.model |
GROUP BY items_6.id |
Export and results provided in attachment.
Attachments
Issue Links
- relates to
-
MDEV-5719 Wrong result with GROUP BY and LEFT OUTER JOIN
- Closed