rudeboymcc
Registered User.
- Local time
- Today, 12:54
- Joined
- Sep 9, 2008
- Messages
- 69
HI. I'm having some trouble with basic SQL. the structure of the database:
Table 1: Properties
Table 2: Flats
Each property can have flats, but there are many houses with no flats.
I'm trying to write an SQL statement to list al the properties and flats in one list.
I can get it to list all the Properties with:
And can get it to list all the Flats with :
The problem is when I use the second one, it does nto show the properties with no flats (becuase the INNER JOIN Flats ON Properties.ID = Flats.Address returns null i guess). Is there any way to concatenate the two statements?
any help is appreciated
Table 1: Properties
Table 2: Flats
Each property can have flats, but there are many houses with no flats.
I'm trying to write an SQL statement to list al the properties and flats in one list.
I can get it to list all the Properties with:
Code:
SELECT Properties.Address
FROM Properties
GROUP BY Properties.Address;
And can get it to list all the Flats with :
Code:
SELECT Properties.Address, Flats.[Flat Number]
FROM Properties INNER JOIN Flats ON Properties.ID = Flats.Address
GROUP BY Properties.Address, Flats.[Flat Number];
The problem is when I use the second one, it does nto show the properties with no flats (becuase the INNER JOIN Flats ON Properties.ID = Flats.Address returns null i guess). Is there any way to concatenate the two statements?
any help is appreciated