Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2003
    Posts
    7

    Unanswered: how to compare two identical parts in a two strings?

    Hello, Is there a string function to compare two identical parts in two strings?

    string one: '00123450'
    string two: '012345'

    Thank you

  2. #2
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Re: how to compare two identical parts in a two strings?

    instr(string1, string2, start_at, occurrence)

    Searches one character string for another character string. INSRT search char1 with a starting position of start_at (an integer) looking for the numeric occurrence within string2. Returns the position of the character in string1 that is the first character of this occurrence.

  3. #3
    Join Date
    Oct 2003
    Location
    ny
    Posts
    23

    Re: how to compare two identical parts in a two strings?

    Originally posted by carloa
    instr(string1, string2, start_at, occurrence)

    Searches one character string for another character string. INSRT search char1 with a starting position of start_at (an integer) looking for the numeric occurrence within string2. Returns the position of the character in string1 that is the first character of this occurrence.

    thank you but how can i create a table base on a comparasion:?

    create table test
    as
    select a.str1, b.str2 , a.id
    from a , b

    thank you

  4. #4
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Re: how to compare two identical parts in a two strings?

    What do you want the table to contain?

  5. #5
    Join Date
    Oct 2003
    Location
    ny
    Posts
    23

    Re: how to compare two identical parts in a two strings?

    Originally posted by carloa
    What do you want the table to contain?


    i have two tables ;

    one has
    id str1 text
    1 010203 'hello'

    another table
    str2
    1020

    i have to create a table like that
    id, str1, str2, test

    to get to the point of getting the ids, i need to compare a str1, str2 first


    thank you so much

  6. #6
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Re: how to compare two identical parts in a two strings?

    What happens if you have

    010203
    010204
    010205

    in first table

    and second table has

    1020

    Do the 3 records above map to the same record in table 2 since they have same patternt minus the first and last digit?

    What is your pattern matching for this mapping?

  7. #7
    Join Date
    Oct 2003
    Location
    ny
    Posts
    23

    Re: how to compare two identical parts in a two strings?

    Originally posted by carloa
    What happens if you have

    010203
    010204
    010205

    in first table

    and second table has

    1020

    Do the 3 records above map to the same record in table 2 since they have same patternt minus the first and last digit?

    What is your pattern matching for this mapping?

    then i need prob a thirs table with str3 and text3
    str3 is equal to str2 and text3 equal to text
    in that case i have to use third table to be able to match not only by str but by text as well

    thank you

Posting Permissions

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