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

data fetch and insert

hello all,
i want to fetch data from one colomn and copy it to the column in a different table..the database is postgres.
please tell me how to do it..
thanks and regards,
Apr 20 '07 #1
4 2550
michaelb
534 Expert 512MB
Either one from the two examples below should work for you:

Expand|Select|Wrap|Line Numbers
  1. INSERT into tableA (columnB)  SELECT columnX FROM tableY;
  2. -- a minor cosmetic touch
  3. INSERT into tableA (columnB)  (SELECT columnX FROM tableY);
  4.  
You can read more on the subject here
Apr 20 '07 #2
thank you for you reply..
actually i have made a mistake in the perception of a problem..
actually i have to update a column which is newly created
i am fetching the records from one column like names
and after making them all capital and removing any unusual character other thaN
alphabets i want them in anothe culumn which is newly created..
so the question is will i have to use insert query or update query
i am confused about the insert and update queries
plz guide me in this regard
thanx


Either one from the two examples below should work for you:

Expand|Select|Wrap|Line Numbers
  1. INSERT into tableA (columnB)  SELECT columnX FROM tableY;
  2. -- a minor cosmetic touch
  3. INSERT into tableA (columnB)  (SELECT columnX FROM tableY);
  4.  
You can read more on the subject here
Apr 25 '07 #3
michaelb
534 Expert 512MB
Do these two columns, the source and the target, both belong to the same table?
Apr 25 '07 #4
yes
they belong to the same table, and
after making them caps and removing
the numbers present in name i want
to check it from anther database and if the name
in these two databases are same then
i want to give the the id
related with the name in first database



Do these two columns, the source and the target, both belong to the same table?
May 2 '07 #5

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

Similar topics

2
by: Jeremy Moncho | last post by:
Hi guys, I am having a comprehension problem for which I cannot seem to find an answer (by banging my head on my keyboard.) I have the following code which yields no results. I expect one...
2
by: MC | last post by:
I am writing a script to retrieve data records of MarinLif table. The problem is that i have a column MarinLif_Picture of type image so the insert is wrong in this way. How do i correct it? ...
0
by: Alexander Vlasenko | last post by:
Please CC me, I am not subscribed. An imaginary SQL statement INSERT INTO table FETCH ... FROM cursor; looks almost the same as currently available INSERT INTO table SELECT ...; I tried it...
13
by: RR | last post by:
Hi, It appears that DB2 has an arbitrary restriction on the use of "fetch first N rows". I want to insert into a table from a large table query, but only insert the first N rows: insert...
15
by: dataguy | last post by:
I am trying to insert into a temporary table but only the first n number of rows. I thought I could use the combination of insert into and fect first row command ,but it won't work. Does anyone...
4
by: dac | last post by:
I am quietly going insane on this project. I've never worked on a project like this one before. All my previous sticky forms were for data entry, not editing. I don't know how to display the form...
4
by: TechnoAtif | last post by:
Hi ALL I have entered some array values using checkboxes into mysql database through a form. Next iam creating a searchpage where all those cateogories inserted through checkboxes has to be...
1
by: boss1 | last post by:
i m having problem with inserting data into oracle db using php. i need to how to fetch fetch multiple row's data from a table in html form and insert into oracle db at a time. may be looping is...
3
by: planey | last post by:
Hi, I was reading topic about setters and getters (http://www.thescripts.com/forum/thread631267.html) and wanted to ask, how they should be used? I have noticed that a general data validators suck,...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.