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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.