423,850 Members | 1,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,850 IT Pros & Developers. It's quick & easy.

Sum of column 1st table and Add data on 2nd table

P: 2
Table 1:
Date OR# Amount
1/1/1990 1 500.00
2/2/1990 2 600.00
=========
1,100.00 How to Sum the Amount Column in 1st Table

Table 2:
Date OR# Amount
3/2/1993 2,000.00

Total Amount : 3,300.00 Add Sum of the 1st Table and 2nd Table
4 Weeks Ago #1
Share this Question
Share on Google+
3 Replies


twinnyfo
Expert Mod 2.5K+
P: 2,704
For your first issue:

Expand|Select|Wrap|Line Numbers
  1. SELECT Sum(OrderAmount) AS OrderTotal 
  2. FROM TableOrders 
  3. GROUP BY Sum(OrderAmount);
For your second issue, you may want to provide more information. Why do you have two tables which apparently have the same information? These should be in the same table. Granted, you may just be showing parts of your tables, but it would make sense to have all your orders in one place.

Hope this hepps!
4 Weeks Ago #2

NeoPa
Expert Mod 15k+
P: 31,121
It looks like you need to read about Database Normalisation and Table Structures before even you read the threads that are stickied at the top to help you to write a question that makes proper sense.

Your database design is the more important issue and once you have that fixed you hopefully won't need to try again with your question.
3 Weeks Ago #3

P: 2
Thanks i will try this
3 Weeks Ago #4

Post your reply

Sign in to post your reply or Sign up for a free account.