473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 896

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

Similar topics

1
by: David | last post by:
Hello, all. I hope somebody in this group can either answer my questions or point me in the right direction. I write Javascript routines that do mathematical, floating point, computations. I...
9
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
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
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
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
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
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
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
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
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.