List:General Discussion« Previous MessageNext Message »
From:Lukasz Budnik Date:May 31 2006 8:04pm
Subject:Re: name 'Szczech' returns more rows then 'Szczec%'
View as plain text  
Hi Sheeri,

On Wed, May 31, 2006 18:11, sheeri kritzer wrote:
> Did you try the first query again?  Is it possible that another
> "Szczech" was added in the time you did both queries?  What happens
> when you the simple
>
> mysql> select id_c, name, from clients where name like 'Szczec%'; and
> mysql> select id_c, name, from clients where name like 'Szczech'; and most
> importantly mysql> select id_c, name, from clients where name = 'Szczech';
>
>
> The answers to those will help figure out what's going wrong.
>

Both "Szczech" exist in system.

I added concat and length to check it there are any white spaces or stuff.

I've just run all 3 queries and the results are:

1. like with 'Szczec%'

mysql> select id_c, name, concat('#',name, '@'), length(name) from clients
where name like 'Szczec%';
+-------+----------+---------------------------+------------------+
| id_c  | name     | concat('#',name, '@')     | length(name)     |
+-------+----------+---------------------------+------------------+
| 30181 | Szczech  | #Szczech@                 |                7 |
+-------+----------+---------------------------+------------------+
1 row in set (0.00 sec)

2. like with full name 'Szczech'

mysql> select id_c, name, concat('#',name, '@'), length(name) from clients
where name like 'Szczech';
+-------+----------+---------------------------+------------------+
| id_c  | name     | concat('#',name, '@')     | length(name)     |
+-------+----------+---------------------------+------------------+
| 30181 | Szczech  | #Szczech@                 |                7 |
| 30693 | Szczech  | #Szczech@                 |                7 |
+-------+----------+---------------------------+------------------+
2 rows in set (0.00 sec)

3. name = 'Szczech'

mysql> select id_c, name, concat('#',name, '@'), length(name) from clients
where name = 'Szczech';
+-------+----------+---------------------------+------------------+
| id_c  | name     | concat('#',name, '@')     | length(name)     |
+-------+----------+---------------------------+------------------+
| 30181 | Szczech  | #Szczech@                 |                7 |
| 30693 | Szczech  | #Szczech@                 |                7 |
+-------+----------+---------------------------+------------------+
2 rows in set (0.00 sec)

I'm losing my mind - no idea what's going on with this name.

Any hints most welcome ;)

best regards
Lukasz Budnik

Thread
name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik31 May
  • Need help querying a database of polynomialsLew E. Lefton31 May
    • Re: Need help querying a database of polynomialsPeter Brawley31 May
      • Re: Need help querying a database of polynomialsPooly31 May
      • Re: Need help querying a database of polynomialsMichael Stassen1 Jun
  • Re: name 'Szczech' returns more rows then 'Szczec%'sheeri kritzer31 May
    • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik31 May
      • Re: name 'Szczech' returns more rows then 'Szczec%'Jake Peavy1 Jun
        • Re: name 'Szczech' returns more rows then 'Szczec%'Brendan Bouffler1 Jun
          • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
            • Re: name 'Szczech' returns more rows then 'Szczec%'Jake Peavy1 Jun
  • Re: name 'Szczech' returns more rows then 'Szczec%'Remo Tex1 Jun
    • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
      • Re: name 'Szczech' returns more rows then 'Szczec%'Remo Tex1 Jun
        • Re: name 'Szczech' returns more rows then 'Szczec%'Lukasz Budnik1 Jun
        • myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')Chris Sansom4 Jun
          • Re: myisamchk (was: name 'Szczech' returns more rows then'Szczec%')Chris Sansom5 Jun
          • Re: myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')gclark5 Jun
            • Re: myisamchk (was: name 'Szczech' returns more rows then 'Szczec%')Chris Sansom8 Jun