I have two large tables, as follows:
First Table:
tbl_properties
id
address
city
state
zip
timestamp
Second Table:
tbl_units
id
propertyID (relates the unit to a property)
unitName
timestamp
I am trying to create a list of all properties without units, AND all units (aligned with its property).
So for an example, if I have:
PROPERTIES:
- 1234 Ashton Lane San Fran, CA 90001
-
6485 Johnson Lane San Fran, CA 54678
UNITS:
-
1A (part of 1234 Ashton)
- 1B (part of 1234 Ashton)
- 1C (part of 1234 Ashton)
Then the query will create the following:
- 1234 Ashton Lane San Fran, CA 90001 – Unit 1A
- 1234 Ashton Lane San Fran, CA 90001 – Unit 1B
- 1234 Ashton Lane San Fran, CA 90001 – Unit 1C
- 6485 Johnson Lane San Fran, CA 54678
Thanks all, for the help.
That’s what left joins are for.