473,396 Members | 2,076 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,396 software developers and data experts.

Update table from other table

Hello,

I have one table which I want to append it with new records, e.g. let's call this table TABLE1. The table from which I want to append is TABLE2. This table is made from queries, so it is always different.

table examples:

TABLE1:

ClientID |Date |Information|...
123 |1/1/11/ |abc
123 |2/1/11/ |def
456 |1/1/11/ |ref
456 |5/1/11 |abc
...

TABLE2:

ClientID |Date |Information|...
123 |1/1/11/ |abc
123 |2/1/11/ |def
123 |2/6/11/ |det

Is it possible to append/update TABLE1 with the information in TABLE2. I would like to have to primary keys: ClientID and Date. And I would like to update TABLE1 only with new information leaving old untouched. The new information is in bold in TABLE2. So the new table should look like this:

ClientID |Date |Information|...
123 |1/1/11/ |abc
123 |2/1/11/ |def
456 |1/1/11/ |ref
456 |5/1/11 |abc
123 |2/6/11/ |det

Can anyone tell how to do that?
Mar 20 '11 #1
6 2254
Rabbit
12,516 Expert Mod 8TB
You could do an outer join and append those that don't exist in table1.
Mar 20 '11 #2
Outer join doesnt help. Can You write the sql statement?
Mar 20 '11 #3
Rabbit
12,516 Expert Mod 8TB
It is not standard procedure to give out code here. And outer join would work. You can use an outer join to determine records that don't exist in one of the joined tables.
Mar 20 '11 #4
NeoPa
32,556 Expert Mod 16PB
Rolandas:
Outer join doesnt help. Can You write the sql statement?
This isn't too clear I'm afraid.
  1. If you mean the approach is wrong for any reason, then you should explain why you think that.
  2. If you are saying the response is not good enough for you, then you should go elsewhere for a while and learn some acceptable manners before returning.
We don't simply provide boilerplate solutions for our members here. We certainly don't expect any of our experts to deal with boorish behaviour.

I hope I've made my meaning clear.
Mar 22 '11 #5
If it didnt help what could I say then?
I solved this question simply aplying append query. It helped because I used 2 primary keys.
Mar 22 '11 #6
NeoPa
32,556 Expert Mod 16PB
Rolandas:
If it didnt help what could I say then?
Well, at the risk of repeating myself :
  1. If you mean the approach is wrong for any reason, then you should explain why you think that.
  2. If you are saying the response is not good enough for you, then you should go elsewhere for a while and learn some acceptable manners before returning.
It's really not complicated, and I've already answered the question before you asked it. I really struggle to understand why you would in the circumstances.
Mar 22 '11 #7

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

Similar topics

0
by: Neoharuo | last post by:
I am working on a VB2003 project that accesses a SQL Server database. The first two forms (frmA, frmB) are almost identicle as far as the processes and data access and updating. I've set it up so...
5
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
5
by: Seth | last post by:
I have one table of the form: Delivery Product 101 A 101 B 101 C 102 A 102 E 103 C 104 A
4
by: Farraige | last post by:
Hi I need your help... I am implementing the method that updates given table (table is represented as list of lists of strings) according to other table (some kind of merging)... This method...
5
by: Hokiecow | last post by:
I'm trying to import specific columns from an excel file (Requirements.xls) into an access table (tblRequirements). Using VBA, I'm able to import the entire excel file into table...
6
by: tone | last post by:
Hi, got: ! ! How to overwrite (update) all elements of ! with Max (or latest) of ! ? I tried if with a Update-Querry - without success. Thankx
1
by: rhepsi | last post by:
HII all, im working on postgresql database where i want to copy the data from one table to other table.... when im trying to write the sql query.. ERROR: 42601: syntax error at or near...
1
by: SydBlack | last post by:
Hi I'm creating a simple inventory system with the option to print reports for individual accounts or grand total for all accounts. The individual reports works just fine, but for the grand...
3
by: pinko1204 | last post by:
My Update function cannot successful update to sql table even don't have any error. Please help to check .....thx PHP1 <?php require_once 'header.php'; ?> <style type="text/css"> <!--
5
by: Ron Mowry | last post by:
im trying to figure out how to create a adhock ticketing system through ms access. I have my main table with 20,000 records. Some records may not need to be modified some may need to be and others...
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?
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...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.