# Logical Transformation - Eliminate Outer Join Example
```7
CREATE TABLE t1 (id INT, val INT);
CREATE TABLE t2 (id INT, val INT);
INSERT INTO t1 VALUES (1, 11), (2, 12), (3, 13), (4, NULL), (5, NULL), (7, 17), (NULL, NULL), (NULL, 19);
INSERT INTO t2 VALUES (1, 21), (2, 22), (3, 23), (4, NULL), (6, 26), (NULL, NULL), (NULL, 29);

SELECT t1.id as t1_id, t1.val as t1_val, t2.id as t2_id, t2.val as t2_val
FROM ~!@t1 LEFT JOIN t2@!~ ON t1.id = t2.id

+-------+--------+-------+--------+
| t1_id | t1_val | t2_id | t2_val |
+-------+--------+-------+--------+
|     1 |     11 |     1 |     21 |
|     2 |     12 |     2 |     22 |
|     3 |     13 |     3 |     23 |
|     4 |   NULL |     4 |   NULL |
|     5 |   NULL |  NULL |   NULL |
|     7 |     17 |  NULL |   NULL |
|  NULL |   NULL |  NULL |   NULL |
|  NULL |     19 |  NULL |   NULL |
+-------+--------+-------+--------+
```

------------------------------------------------------------------------------
The query is designed to perform a left outer join from table `t1` to table `t2`, ensuring that rows in table `t1` have corresponding matches in table `t2` based on the `val` column. If there are no matching rows in table `t2`, rows from table `t1` will still be included in the final result set, with all columns from table `t2` represented as `NULL`.