Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to copy data from one column into another?

Status
Not open for further replies.

jtammyg

Technical User
Dec 16, 2002
30
US
Hi!

I want to copy the data from column 1 into column 2. Column2 is empty.

COLUMN1 COLUMN2
1234
3456
4567
5678
3215

I have tried a statement but it does not work.

I am using Pervasive 7. Any ideas please?

thanks a lot!

Tammy
 
update t set column2 = column1

What have you tried? What problem did that incur?
 
I tried:

update table1 set table1.column1=table2.column2 from table1,table2 where table1.type='88'

It did not work.

Scalable error 507.
 
Oh, the columns are in different tables. Thank you for that information. The syntax that you used is not standard but specific to sql server/sybase.

How are table1 and table2 related?
 
Update table1 t1
set column1 = (select column2
from table2
where profileid = t1.profileid)
 
Still not working. Error 844. Invalid number of rows selected.
 
So there may be multiple rows in table2 with the same profileid? Which of those should be chosen?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top