[sql] regex

Robert Brenstein rjb at rz.uni-potsdam.de
Mon Feb 10 14:09:06 CST 2003


>on 2/10/03 6:16 AM, Robert Brenstein at rjb at rz.uni-potsdam.de wrote:
>
>>  Why the following sql
>>
>>  SELECT r_fna,r_mna,r_lna,r_ema,r_rid
>>  FROM registration1,registration2b
>  > WHERE u_rid = r_rid and r_rid > 0 and
>>  u_mtch LIKE '\broberto\b' and u_mtch LIKE '\bbrenstein\b'
>>
>>  finds match for field containing "robert j brenstein"? robert is not
>>  roberto, so it should fail in the first LIKE.
>>
>>  When I made the second LIKE non-matching, then the SQL fails as expected.
>>
>>  SELECT r_fna,r_mna,r_lna,r_ema,r_rid
>>  FROM registration1,registration2b
>>  WHERE u_rid = r_rid and r_rid > 0 and
>>  u_mtch LIKE '\brobert\b' and u_mtch LIKE '\bbrensteinson\b'
>>
>>  I am confused. I want to do search on full words.
>
>Sounds like left LIKE works correctly, but problem in AND ?
>I will check.
>
>Robert,
>
>Field u_mtch is the same from the same table?
>Then this problem should be for simpler query with on FROM table, yes?
>
>Please check this.
>
>May be second table give side effect.
>
>Let me know result
>

I just had an idea to remove the

and r_rid > 0

component and... all queries work fine for two tables. I mean both 
regex and non-regex. Spooky.

Robert


More information about the Valentina mailing list