Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    30

    Post Unanswered: LIKE Condition Pattern List ?

    Hi,

    When coding a LIKE condition ( in Oracle ), is it possible to search for a keyword that is followed by one character in a defined pattern list ? eg.

    LIKE '%keyword[abc]%'

    so that the column must obviously contain the value 'keyword' but also be followed directly by the character 'a', 'b', or 'c' ?

    I want to be able to do this in one statement instead of

    LIKE '%keyworda%' OR
    LIKE '%keywordb%' OR
    LIKE '%keywordc%'

    Is this possible ? I dont really want to do it using in INSTR, search for the position of keyword and see what the next character is, because if
    'keyword' exists twice it will not pick up the second occurance...

    Thanks,
    Adam

  2. #2
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas, USA
    Posts
    68
    I have a dollar/ruble/lire/euro/peso/etc. that says it's not possible.

  3. #3
    Join Date
    Mar 2004
    Posts
    30

    Answer

    well what i should have mentioned before is, that my pattern of characters on the end would never exist in my keyword ( eg. keyword is a table_name, pattern-list would be punctuation [;, ], and those characters will never exist in a table_name...

    so it was achieved by :

    WHERE TRANSALTE(column_name, '; ', ',,') LIKE '%keyword,%'

    so just converting all of the list of pattern characters to the one... but i didnt really mention that before with the pattern-list not even belonging in the keyword did i ?

    does that earn me 50c AU instead of the full dollar ?

    Adam :-)

  4. #4
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas, USA
    Posts
    68
    The check is in the mail

Posting Permissions

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