Link to home
Start Free TrialLog in
Avatar of jondanger
jondanger

asked on

create SQL View with calculation

Hi Experts,

Hopefully the image explains what i'm trying to achieve better than i can type it!

I'm trying to build "viewC", from the data in tableA and tableB.

I'm really struggling, please help!

Thanks
Jon





Bilderman-2009.04.21-21-36-52.png
Avatar of jondanger
jondanger

ASKER

I forgot to mention performance is critical as tableA contains 3,000,000 rows and grows by 50,000 rows per day.

tableB only grows by 1 row per day. (60 rows at present)

i'll add inserts for the test data in the next post :-)

CREATE TABLE [testdb].[dbo].[TableA](
	[aDate] [datetime] NULL,
	[aNumber] [smallint] NULL
) ON [PRIMARY]
 
CREATE TABLE [testdb].[dbo].[TableB](
	[bDate] [datetime] NULL,
	[bNumber] [smallint] NULL
) ON [PRIMARY]

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Nathan Riley
Nathan Riley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial