Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Correct addition from 2 tables
Message
From
16/06/2014 17:32:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Correct addition from 2 tables
Environment versions
Visual FoxPro:
VFP 5
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01601931
Message ID:
01601931
Views:
58
Hi All:

Please consider the following:
Table1:

Custno     Sales
ABCD      40000
XYZS      20000

Table2:

Custno     Sales
XYZS      100
YYYY      7000
I want to come up with SQL that will generate a cursor called cursor1 with total sales for each customer:
Cursor1:

Custno     TotalSales
ABCD      40000
XYZS      20100
YYYY      7000
Note that custno ABCD is absent from table2, XYZS is present in both and YYYY is absent from table1. Also, please note that this is for VFP 5, so nesting SELECTs may not work.

Thanks,

Yossi
Next
Reply
Map
View

Click here to load this message in the networking platform