Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    canada
    Posts
    230

    Unanswered: please HELP for writing sql statement!!!!!

    Hi All,

    I use db2 v8.2.3 and aix 5.2

    I need to retrive some last name that have unkown space before "MR" from "LAST_NAME (varchar (128)) column of table TAB1.

    e.g.

    select last_name from TAB1 where last_name like ' '||MR ;

    BUT I do not know the number of spaces before MR, do we have any function?

    Thank you in advance for your help

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Maybe something like:

    where ltrim(last_name) = 'MR" and last_name <> 'MR'

    Andy

  3. #3
    Join Date
    Sep 2003
    Location
    canada
    Posts
    230
    Quote Originally Posted by ARWinner
    Maybe something like:

    where ltrim(last_name) = 'MR" and last_name <> 'MR'

    Andy
    Thank you so much Andy

Posting Permissions

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