Hi,
i my query is
select pf.PropertyId,count(pf.FeatureId) as Count from SaleProperties sp left join PropertyFeatures pf on sp.PropertyId=pf.PropertyId left join Features f on f.FeatureId=pf.FeatureId where f.FeatureType in('Parking','Rural/secluded','Waterfront') group by pf.PropertyId
it give the result that has featuretype in either 'Parking','Rural/secluded','Waterfront' .i want result that the property has has all three featuretype
how to query it
Loading
Ganesh MPosted Aug 25, 2014, 8:13 AM
these are my tables
Feature table
id Type
1 Fireplace
2 Garden
3 Central heating
4 Disabled features
5 Parking
6 Porter/security
Property table
Id Address
1 Britton Street London London
2 Empire Way Middlesex Wembley Wembley
3 Compass Close,Cowley London London
4 "The Epsom" at Fogwell Road, Botley, Oxford Oxford
5 Exchange Buildings, High Street High Barnet High Barnet
PropertyFeature Table
id Propertyid Featurreid
1 1 1
2 1 2
3 2 2
4 2 3
5 2 4
the feature id of garden is 2
if i give garden then it will list propertyid 1 and 2
if i give garden,fireplace then it will list propertyid 1 only how to do that