|
Posted by burke.david on 09/07/05 14:00
I have two tables Bill and Location.
Bill
(
location_id int,
prod_period datetime,
consumption float,
demand float
)
Location
(
location_id int,
location_name varchar(45)
)
I want to create a stored procedure that takes a parameter of @year. I
basically want the procedure to return results that show locations
where consumption and/or demand IS NULL or 0 for each month throughout
a given year. I would like my results to look something like this:
location_id year Jan Feb Mar Apr May Jun Jul Aug Sept Oct
Nov Dec
1 2005 0 0 0
2 2005 0 0 0 0
3 2005 0 0
If data does exist for consumption or demand, I would like to show it,
however I am really interested in the locations that have no data
associated with them.
Any ideas of how I can accomplish this?
Navigation:
[Reply to this message]
|