Tuesday, September 25, 2012

manipulate strings in SQL

  1. LTRIM(@mystring) will remove the space off the front of @mystring
  2. RTRIM(@mystring) will remove the space off the end of @mystring
  3. RIGHT(@mystring,5) will give the last five characters in @mystring or all of the characters in @mystring if @mystring is less than six characters in length
  4. LEFT(@mystring,5) will give the first five characters in @mystring or all of the characters in @mystring if @mystring is less than six characters in length

No comments:

Post a Comment