Please post the DDL for the underlying tables, plus INSERT statements of
sample data and the expected output.
--
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com ..
[quoted text, click to view] <limsy@newsgroups.nospam> wrote in message
news:%23poGcmLyFHA.2792@tk2msftngp13.phx.gbl...
Hi ppl,
I need to create a view which contains both SALES and CANCELLATION/RETURN
data.
Is it possible for a VIEW to store data from 2 sources?
Eg.
Create VIEW MyView (RefNo, Date, Data1, Data2, etc...)
As Select (sales_table.SalesNo, sales_table.SalesDate, ..)
From sales_table
Where ....
How to I add data from my table containing cancellations and returns? Add
more AS SELECT statements at the bottom?
If this is not the way... plz point me to the right method.
The idea is to be able to retrieve just SALES ... or just RETURNS ... or
BOTH (sales having +ve while returns -ve)
from 1 View.
Any info/help is greatly appreciated. Thanks.
Limsy.