Click to See Complete Forum and Search --> : [RESOLVED] Copy records, limit characters?


st3ady
07-20-2006, 04:25 PM
How could I go about doing the following:

I have a column with lets say

AHA1
AHA2
AHA3
AHE1
AHE2
ARL1
ARL2

How could I make a column next to it that is basically the same but cuts off anything after the third letter? So this new column would look like:

AHA
AHA
AHA
AHE
AHE
ARL
ARL

Thanks! :)

chazzy
07-20-2006, 04:48 PM
most dbms have a substr/substring function.

st3ady
07-20-2006, 05:17 PM
thanks, a nice person over at sqlteam.com helped me out:
select col1, left(col1,3)...
and it did the job,
cheers :)