tags:

views:

38

answers:

2

Is there a single query (subqueries in it are allowed) where I can copy the content of one field into another field, per row. Example:

price, and priceBackup

Records:

45.55

47.77

45.55 copies into priceBackup for that specific row,

47.77 copies into priceBackup for that specific row.

I do have a primary key, auto increment on it under 'id'.

Thanks guys!

A: 
UPDATE table1 SET priceBackup = price

Add a WHERE clause if you only want to do this for some rows.

Mark Byers
Worked, thanks Mark.
Rob Adler
A: 

update table blah set priceBackup=price;

Brian Dilley