So basically I have 2 tables:
name | table2.id
So, you asked if it is possible with MySQL and I answered in comments that it is. If your question was how can I accomplish this with only MySQL, here it is:
SELECT tmp.name, tbl2.id FROM tbl2 LEFT JOIN ( SELECT tbl2.id AS id, tbl1.`name` AS name FROM tbl2 INNER JOIN tbl1 ON tbl1.id = tbl2.tbl1_id GROUP BY tbl2.tbl1_id ) AS tmp ON tbl2.id = tmp.id;
Hope it is what you wanted.