Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    4

    Unanswered: prefix matching..

    I have two tables like this. Now I want to match the country,op_name and operator_code with the dialed number of table1. Each dialed number has a op_prefix on the beginning the the dialed number. but the op_prefixes are not same in length.

    Here Olo and tirana have a four digit similar prefix. The result should output the best prefix matching.

    I am a newbie. pls help.
    Attached Thumbnails Attached Thumbnails Capture1.PNG  
    Last edited by shuvoishere; 10-22-12 at 02:43.

  2. #2
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    Starting from the left in columns(operator_code and called_number), Exactly how many characters have to match?

    You can try something like below, but operator_code would have to have an exact match with the matching positions in called_number:
    Code:
    select t2.country, t2.op_name, t2.operator_code, t1.called_number, t1.call_id
     from  schema.table2 t2 join schema.table1 t1 on to_char( t2.operator_code ) like to_char( t1.called_number || '%' )

Posting Permissions

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