Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Unanswered: searching for numerals

    hi all,

    I have a column which may or maynot contain numerals, eg: 'europe123'.
    My query should return 1 if it contains numerals, no matter how many numerals are in it. ie for the above eg it should give 1.
    how can i do that? if using 'Like' how can we specify all the numbers from 0-9 ?

    Thnaks in advance,
    chits

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    This query will return 1 if your string contains number or 0 if it doesn't:
    Code:
    SELECT SUBSTR(TO_NUMBER(TRANSLATE('europe123', 
                                      'abcdefghijklmnopqrstuvwxyz0123456789',
                                      '000000000000000000000000001111111111'
                 )), 1, 1) does_it_contain_number
    FROM dual;

  3. #3
    Join Date
    Feb 2005
    Posts
    4

    Re:Searching for numerals

    it did work.. thanks friend.

Posting Permissions

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