List:General Discussion« Previous MessageNext Message »
From:Jim Faucette Date:May 3 1999 8:15pm
Subject:Re: possibly interesting sub_string problem
View as plain text  
gl3 wrote:
> 
> I'm getting different results with seemingly equal query strings. 

Gavin, these are not equivalent.

> Goal is
> to find all occurances of the word "INDIAN" within a field of a certain
> table. 

Then the first query is the one you should use.

> Query #1:
> 
> select * from $TABLENAME where (title like "%INDIAN%");
> 
> Results: 730

This says return all records that contain INDIAN.

> 
> Query #2:
> 
> select * from $TABLENAME where (title like "% INDIAN %");
> 
> Results: 336

This says return all records containing INDIAN that has a single leading
and trailing space.

> 
> Query #3:
> 
> select * from $TABLENAME where (title like "% INDIAN%");
> 
> Results: 339

Return all containing INDIAN that has a single leading space.

> 
> Query #4:
> 
> select * from $TABLENAME where (title like "%INDIAN %")
> 
> Results: 726

Return all containing INDIAN that has a single trailing space.

  jim...
Thread
possibly interesting sub_string problemgl33 May
  • Re: possibly interesting sub_string problemJim Faucette4 May
  • Re: possibly interesting sub_string problemChristian Mack4 May