database - SQL - Visual Studio - fill table if related data is empty -


in data source "properties" linked "tenants" , want fill table using sql query tenant not exist property. in other words, "where property vacant."

what sql statement this?

select tblproperties.type, tblproperties.propertyid, tblproperties.street, tblproperties.unit, tblproperties.city, tblproperties.state, tblproperties.zip, tblproperties.description, tbltenant.tenantid dbo.tblproperties join tbltenant  on tblproperties.propertyid = tbltenant.propertyid tbltenant.tenantid = '' 

properties , tenants both tables in database?

are joined cross-reference table or...? helpful see table structures.

assuming that's case, want like:

select * properties  propertyid not in     (select propertyid propertytenants) 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -