DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Help w/ select statement

  1. #1
    Join Date
    Aug 2003
    Posts
    100

    Help w/ select statement

    Greetings,

    I have data in a column (CHAR(25))that looks like this:

    '! A0076D2 '
    '! A0078 '
    '! A0133CH1 '
    '! X245700000 '

    How can I select just the text minus the leading/trailing spaces and exclamation point (ie: 'A0076D2', 'A0078', 'A0133CH1', 'X245700000')


    Thanks in advance.

    Steve

  2. #2
    Join Date
    Aug 2003
    Location
    Southern Jersey
    Posts
    16
    Look into the substr, rtrim, and ltrim SQL functions.

  3. #3
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    409
    Try this :

    select trim(ltrim( your_column, '!')) from your_table;

    HTH.
    -- Dilip

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width