I joined two tables
SELECT
t1.column1,
t2.column2
FROM
t1 JOIN t2 cu
ON t1.id = t2.id AND t1.col LIKE 'A%'
SELECT
t1.column1,
t2.column2
FROM
t1 JOIN t2 cu
ON t1.id = t2.id AND t1.col LIKE 'B%'
How could i intersect these tables so I can have the following output (ids that have both the A% and B%)
join 1
id | col
---┼------
1 | Axxxx
2 | Axxxx
join 2
id | col
---┼-------
1 | Bxxxx
3 | Bxxxx
Final output
id | col
---┼-------
1 | Axxxx
1 | Bxxxx
Thank you