Append a string to all the values in a column SQL

Append a string to all the values in a column SQL

am 13.01.2006 17:44:07 von gtg974p

Sub: Append a string to all the values in a column SQL
Hi all,

This might be a very simple query. But I am new to SQL programming.
Hope someone can help me.

I have a table ---

1634 Fred los angeles
123 Sam
1245 abc
1231 ....
1278 .....
578 ....

I want to append TD before the numbers in the first column, I know
there should be a simple statement for this. But I am not getting it as
I have done SQL.
I would like to get

TD1634 Fred los angeles
TD123 Sam
TD1245 abc
TD1231 ....
TD1278 .....
TD578 ....

Hope someone can help me.

Thanks.

Re: Append a string to all the values in a column SQL

am 13.01.2006 18:44:42 von Bill Karwin

wrote in message
news:1137170647.390916.262600@f14g2000cwb.googlegroups.com.. .
> 1634 Fred los angeles
>
> I want to append TD before the numbers in the first column,
> I would like to get
>
> TD1634 Fred los angeles

SELECT CONCAT('TD', field1) AS TD_field1,
field2, field3
FROM my Table;

See http://dev.mysql.com/doc/refman/5.0/en/string-functions.html for more
details on the CONCAT function.

Regards,
Bill K.