Jump to content

Possible JOIN help


coupe-r

Recommended Posts

Hey Guys,

 

What I am trying to do is populate a drop down box with properties (Addresses), only if the # of occupants have not been reached.  If a property has 2 occupants and only 1 tenants has that property id, it should still be populated.

 

Property            Tenants

Property_id          Teanant_id

occupants            property_id

 

SELECT * FROM property LEFT JOIN tenants ON property.property_id = tenants.property_id

WHERE .........................

 

Clueless on how I compare the count of tenants.property_id's and property.occupants.

 

Please help

Link to comment
https://forums.phpfreaks.com/topic/189926-possible-join-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.