June 30, 2006 at 8:50 am
I want to take the content of two columns, concatenate them and place them into the 3rd column.
Something like:
UPDATE Table_name
SET Age_range = Age_start + '_' + Age_end
June 30, 2006 at 9:00 am
You should use an indexed calculated column since that way the data is maintained automatically and can't be overwritten:
Better still, don't do this in the database at all as it's really a task for the presentation layer.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 30, 2006 at 9:07 am
That does not work because it tries to create the column and a integer type.
June 30, 2006 at 9:10 am
alter table Table_name add Age_range as cast(Age_start as varchar(10)) + '_' + cast(Age_end as varchar(10))
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply