By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,083 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,083 IT Pros & Developers. It's quick & easy.

data fetch and insert

P: 20
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
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 534
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

P: 20
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

Expert 100+
P: 534
Do these two columns, the source and the target, both belong to the same table?
Apr 25 '07 #4

P: 20
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

Post your reply

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