MariaDB [test]> 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; +----+-------+-------+----------+--------+--------+ | id | brand | model | imported | brand1 | model1 | +----+-------+-------+----------+--------+--------+ | 28 | 54 | 618 | 0 | NULL | NULL | | 29 | 65 | 1133 | 0 | NULL | NULL | | 30 | 123 | 0 | 0 | NULL | NULL | +----+-------+-------+----------+--------+--------+ 3 rows in set (0.00 sec) MariaDB [test]> DELETE FROM items_6 WHERE id=30; Query OK, 1 row affected (0.01 sec) MariaDB [test]> 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; +----+-------+-------+----------+------------+--------+ | id | brand | model | imported | brand1 | model1 | +----+-------+-------+----------+------------+--------+ | 28 | 54 | 618 | 0 | NULL | NULL | | 29 | 65 | 1133 | 0 | Volkswagen | Touran | +----+-------+-------+----------+------------+--------+ 2 rows in set (0.00 sec)