473,320 Members | 1,896 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,320 software developers and data experts.

SQL Update Tables

1
Hi, I am new to Oracle and this forum. Apologies if posted in the wrong section.

Need help to update "VALUE_FROM_TAB_A" column in table TAB_B with values from table TAB_A.

The structures of the tables are as follows:


TAB_A
-----------
ID | Value
-----------
1 | XXX
2 | YYY
3 | ZZZ

TAB_B
---------------------
ID | VALUE_FROM_TAB_A
---------------------
1 |
1 |
2 |
3 |
3 |
3 |

Much Regrds,
Nino
Apr 22 '06 #1
3 9119
Hi, I am new to Oracle and this forum. Apologies if posted in the wrong section.

Need help to update "VALUE_FROM_TAB_A" column in table TAB_B with values from table TAB_A.

The structures of the tables are as follows:


TAB_A
-----------
ID | Value
-----------
1 | XXX
2 | YYY
3 | ZZZ

TAB_B
---------------------
ID | VALUE_FROM_TAB_A
---------------------
1 |
1 |
2 |
3 |
3 |
3 |

Much Regrds,
Nino

Update Tab_B Set VALUE_FROM_TAB_A = TAB_A.Value Where
Tab_B.ID = Tab_A.ID;

Mahesh
Jul 31 '06 #2
Try the following:

update tab_b set value_from_tab_a = (select a.value from tab_a a where a.id = tab_b.id)

Hope this helps
Aug 4 '06 #3
Hi, I am new to Oracle and this forum. Apologies if posted in the wrong section.

Need help to update "VALUE_FROM_TAB_A" column in table TAB_B with values from table TAB_A.

The structures of the tables are as follows:


TAB_A
-----------
ID | Value
-----------
1 | XXX
2 | YYY
3 | ZZZ

TAB_B
---------------------
ID | VALUE_FROM_TAB_A
---------------------
1 |
1 |
2 |
3 |
3 |
3 |

Much Regrds,
Nino
Hi,
I think the following will do the job for you!

UPDATE TAB_B B
SET VALUE_FROM_TAB_A = (SELECT VALUE
FROM TAB_A
WHERE ID=B.ID)
/

All the best.
Aug 6 '06 #4

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

Similar topics

3
by: Sunshine | last post by:
Hello and thank you for your time. I have never worked with sql server and currently have a project updating the database. I have a CSV file as follows: id keywords (this field contains commas...
1
by: Pesko S | last post by:
Hi, Could anybody just point me in a direction where I can find information on how the heck I can update a database with relational data from an XML file. I use stored procedures to insert...
0
by: ANSWER | last post by:
Hi, I have database with 20 tables, CODE (long integer)is primary key for all of them but half of the tables is linked indirectly to the main tables CODE. That works great until I had to change...
3
by: wildbill | last post by:
I have an Excel spreadsheet with 1000+ rows that I need to import into an Access 2002 db once a month or so. I then need to use that information to update any existing records(multiple fields may...
4
by: Jozef | last post by:
Hello, I'm trying to check for and add a field to a table to a back end database through code. The problem I've been faced with is changing permissions, because I have to use administer...
3
by: pradeep | last post by:
Hi, I amnew to this group and lucky to have found this group. i have a master table which has different types of application say Desktop, Mainframes, etc. I have an individual table for each...
2
by: Ivan | last post by:
Hi to all !!! I am new working with DB2. I have one table with 4 primary key (CLIENTID, TIMESTAMP,ENTITYTYPE,ENTITYID) and I need update this table (HISTORY). First I drop the Primary Key,...
4
by: dstorms | last post by:
I'm trying to run an update query on multiple tables, and since Access doesn't allow me to update tables from a union query, I'm writing a module as a workaround. So I've set up a temporary recordest...
1
by: SKODA | last post by:
Hi, Could someone help me in knowing how to update tables in MS Access with data available on a website? I mean the functionality similar to refresh available in MS EXCEL where the data is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.