Question: I have two tables t1 & t2. In t1, there are 1641787 records. In t2, there are 33176007 records. I want to take two columns from t2 and keep everything of t1 using a left join. When I use left join with t1 to t2, I got more records than t1. I would like to get a similar number of records as t1 after joining. Please give me a suggestion. There are many to many relationships between the tables. Here is my code:

```
SELECT t1.*, t2.City
FROM t1 LEFT JOIN t2 ON t1.ID = t2.ID;

```

Answer: 
You need to aggregate `t2` *before* joining:

```
SELECT t1.*, t2.City
FROM t1 LEFT JOIN
     (SELECT t2.ID, ANY_VALUE(t2.City) as City
      FROM t2
      GROUP BY t2.ID)
     ) t2
     ON t1.ID = t2.ID;

```
"select **destinct** ..."
 add a "order by"

Like this:

```
SELECT DESTINCT t1.*, t2.City
FROM t1 LEFT JOIN t2 ON t1.ID = t2.ID
ORDER BY t1.name ASC;

```