-2

I am trying to remove/trim everything after 7 characters.

issue #1 removing everything after 6 or 7 chracters example: 1Q7 4B7 MY NAME IS MARY

Results I want: 1Q7 4B7

issue #2 removing one space example: EQ9 2IQ Results I want: EQ9 2IQ

Please assist.

Thanks

1 Answers1

0

SUBSTRING

SELECT SUBSTR(column, 1, 6) AS MYCOLUMN FROM TABLE

Something like this should do the trick; you may have to fiddle with the numbers.

More SUBSTR Examples

crownedzero
  • 496
  • 1
  • 7
  • 18
  • Issue #1 resolved ...Thank you :) Can you assist in issue #2 plz. – user2414431 Nov 27 '13 at 16:33
  • This should work for either case. Read the documentation. The first param (1) says 'start at this character', the second param (6) says 'Give me this many characters from the start point'. You should be able to tweak this for both cases (in fact they should give you the same result either way.) Kindly accept the answer if it works for you. – crownedzero Nov 27 '13 at 16:42