0

I have two tables and I would like to run a query that does something like this, where both columns can be null:

SELECT tableA.id as tableA, tableB.id as tableB
   LEFT JOIN tableA WHERE tableA.name LIKE 'blah%'
   LEFT JOIN tableB WHERE tableB.name LIKE 'blah%'

I know these queries aren't correct, but I'm trying to just convey the general idea of what I want. What I am looking for is to be able to return the following result set

+------------+----+
| tableA | tableB |
+------------+----+
|  NULL  |   1    |
+------------+----+

+------------+----+
| tableA | tableB |
+------------+----+
|  NULL  |  NULL  |
+------------+----+

+------------+----+
| tableA | tableB |
+------------+----+
| 1      |  1     |
+------------+----+
Jason M
  • 1,013
  • 13
  • 25

0 Answers0