Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    14

    Unanswered: help in SQL function

    Can anyone tell me how to get the records where UNIT has the numeric values?

    UNIT_KEY(INT) UNIT(VARCHAR)
    1000 ABCDE
    2000 20
    3000 10
    4000 30
    5000 HAHA

    The result should be
    UNIT_KEY(INT) UNIT(VARCHAR)
    2000 20
    3000 10
    4000 30

  2. #2
    Join Date
    Sep 2003
    Posts
    84
    Think this should work :-
    SELECT UNIT_KEY, UNIT from table where upper(UNIT) = UNIT and lower(UNIT) = UNIT

  3. #3
    Join Date
    Dec 2002
    Posts
    134
    the example above will not work on " ' , - and so on.
    You can try using translate function:

    SELECT UNIT_KEY, UNIT from table
    where length(translate('UNIT', '', '1234567890'))=0

Posting Permissions

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