i am new to mysql, i am writing a program where there are 3 tables
1. property_types (id, typename)
Data : (1, houses) (2, shops) (3, restaurants)…
2. properties (id, propertyname, typeid)
Data : (1, houses-1, 1) (2, houses-1, 1) (3, shop-1, 2)…
3. properties_rent (id, propertyid, amount, year)
Data : (1, 1, 500.00, 2010) (2, 1, 500.00, 2011) (3, 2, 700.00, 2010)…
I need to list ALL properties of a kind (property type eg: shops) who haven’t paid the rent for 2012, so basically if a property (house-1) have paid rent for 2010 & 2011 but not 2012 it should be listed, and also a property (restaurant-1) have not paid any rent (no records in rent table) should also be listed…
Thanks in advance…
Please try this.