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

ios - iPhone/iPad different view orientations in different views , and apple approval process -

monitor web browser programmatically in Android? -

c# - Using multiple datasets in RDLC -