mySQL: column data to be copied into another column
Apologies for this trivial question but I have tried some of the similar
answers supplied here to no avail.
I am creating a single database (merging two sets on Irish census data
from 1901 and 1911).
I have a column Age (containing peoples ages) and also a column 1901Age
(currently empty). I would like to automatically copy the data in the Age
column into 1901Age column.
I am learning SQL on the fly, so am a novice to this but INSERT SELECT and
various similar permutations did not work for me.
If I could also do the above with a where column tagged on – the one below
filters the results to which I need to apply my above query (if that makes
sense!)
UPDATE `Census`.`Merged`
SET `Age` = `1901Age`
WHERE (
(
`Age` >= '0'
)
AND (
`1901Age` = '0'
AND `BothCensusStatus` = '1901Only'
No comments:
Post a Comment