cravincreeks
Technical User
Hello all,
I'm stuck on this query. I have a Parcels table which has a record for every parcel such as
I also have a land use table that relates to the parcel via the ParcelID. A single parcel can have many land uses.
I need to query for all parcels that have an Industrial AND Commercial land use. In the example above, Parcel1, and only Parcel1, should be returned. If I query for WHERE LandUse = 'Industrial' and LandUse = 'Commercial', zero records are returned. If I put an OR in the Where clause, I'd get Parcels 1,2, AND 3, which is not what I need.
How do I get what I need?
Thanks
I'm stuck on this query. I have a Parcels table which has a record for every parcel such as
Code:
ParcelID
--------
Parcel1
Parcel2
Parcel3
Parcel4
Code:
ParcelID LandUse
-------- ----------
Parcel1 Industrial
Parcel1 Commercial
Parcel1 Office
Parcel2 Commercial
Parcel2 Office
Parcel3 Commercial
Parcel3 Office
I need to query for all parcels that have an Industrial AND Commercial land use. In the example above, Parcel1, and only Parcel1, should be returned. If I query for WHERE LandUse = 'Industrial' and LandUse = 'Commercial', zero records are returned. If I put an OR in the Where clause, I'd get Parcels 1,2, AND 3, which is not what I need.
How do I get what I need?
Thanks