473,508 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

computations when doing a join

I have two tables with the same structure and need to compare the
similar rows where they exist. That's the easy part. However, I can't
figure out a way to do a calculation when a specific row only exists
in one of the tables.

Ex:
Table A
--------------
| id | value |
--------------
| 1 | 10 |
| 2 | 20 |
--------------

Table B
--------------
| id | value |
--------------
| 2 | 25 |
| 3 | 35 |
--------------

I'd like the result to reflect the sum of the values
--------------
| id | value |
--------------
| 1 | 10 |
| 2 | 45 |
| 3 | 65 |
--------------

But what I get when doing a join is
--------------
| id | value |
--------------
| 1 | 10 |
| 2 | null |
| 3 | null |
--------------

I feel like the process should be simple but haven't had any luck
using Joins or Unions to do this. Any ideas? Thanks in advance
Jul 19 '05 #1
0 871

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6395
by: Chris Greening | last post by:
I'm seeing a very strange problem with outer joins. The example below replicates the problem: create table data1 (dim1 integer, stat1 float); create table data2 (dim1 integer, stat2 float); ...
0
901
by: Josh | last post by:
I have two tables with the same structure and need to compare the similar rows where they exist. That's the easy part. However, I can't figure out a way to do a calculation when a specific row only...
4
4845
by: thilbert | last post by:
All, I have a perplexing problem that I hope someone can help me with. I have the following table struct: Permission ----------------- PermissionId Permission
3
10040
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def,...
6
3047
by: jao | last post by:
My company has a product in beta which uses Postgres 7.4.3. We expect to have a code freeze for our 1.0 product in March 2005. I'd really like to use Postgres 8.x in our 1.0 product. We're...
1
1127
by: Dan | last post by:
Hi All, Firstly my apologies. I am not really an access user so if this question seems fundamental I am sorry. I am trying to replicate this query using another programming language. Want I...
4
292
by: Robert Dufour | last post by:
I have two classes , class1 and class2 In class1 I have Public Overload function Fct1(paramlist) as string some code end function Public overloads Function Fct1(otherparamlist) as string...
7
2506
by: Gary Brown | last post by:
Hi, I have a computation intensive application that tries to update the display quite often. After a few seconds the window stops updating and the window goes blank. A breakpoint in the Paint...
16
2612
by: techystud | last post by:
Hi, I am doing a Left Join between two views wherein the column used in the ON condition has empty string rows in the first view. while running the query the application flashes, shows #ERROR...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.