Hi
I have a general database question, that will effect the output from my database to a form which is being developed in .NET, it may seem very simple but I cannot make head nor tail from it.
I need to create a SELECT statement that will select all data from a table called HOUSE, but also count the number of instances of the word "BEDROOM" from a table ROOM which is linked to HOUSE through a link table HOUSE_ROOM. I also want collect the number of tenants who are associated with that house from table TENANT , and finally I want to collect the total rent collected from each tenant, this comes for a LOGBOOK table which is link to a house through the tenant.
Am I best deriving this data since the number of rooms and tenants is unlikely to change that often or calculate on the fly which is where my problem is. How can you create a select statement with several sum and/or count functions?
I have a general database question, that will effect the output from my database to a form which is being developed in .NET, it may seem very simple but I cannot make head nor tail from it.
I need to create a SELECT statement that will select all data from a table called HOUSE, but also count the number of instances of the word "BEDROOM" from a table ROOM which is linked to HOUSE through a link table HOUSE_ROOM. I also want collect the number of tenants who are associated with that house from table TENANT , and finally I want to collect the total rent collected from each tenant, this comes for a LOGBOOK table which is link to a house through the tenant.
Am I best deriving this data since the number of rooms and tenants is unlikely to change that often or calculate on the fly which is where my problem is. How can you create a select statement with several sum and/or count functions?
Comment