471,049 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

simple SQL update

I need to copy data from one column that has a max size of 45 characters to
a column that has a max size of 20 characters.

What is the syntax to say fill the first 20 characters out of 45 from
column 1 into column 2?

jeff

--
Message posted via http://www.sqlmonster.com
Jul 23 '05 #1
1 1184
Jeffrey Sheldon via SQLMonster.com wrote:
I need to copy data from one column that has a max size of 45 characters
to a column that has a max size of 20 characters.

What is the syntax to say fill the first 20 characters out of 45 from
column 1 into column 2?
The LEFT function returns the 1st how many characters of a field you want

So something like UPDATE Table
SET Column1 = LEFT(Column2, 20)

would do the trick

Jayne


Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Samantha Smit | last post: by
7 posts views Thread by Steven | last post: by
10 posts views Thread by serge calderara | last post: by
6 posts views Thread by Arne Beruldsen | last post: by
3 posts views Thread by deejayquai | last post: by
11 posts views Thread by James R. Davis | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.