424,289 Members | 1,911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,289 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
Nov 16 '18 #1
Share this Question
Share on Google+
3 Replies


twinnyfo
Expert Mod 2.5K+
P: 2,888
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!
Nov 16 '18 #2

NeoPa
Expert Mod 15k+
P: 31,186
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.
Nov 17 '18 #3

P: 2
Thanks i will try this
Nov 19 '18 #4

Post your reply

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