Subject Re: [firebird-support] Like, = and space in varchar
Author Ivan Prenosil
> can someone explain me this :
>
> create table ztest (car varchar(5));
> commit;
> insert into ztest (car) values ('');
> insert into ztest (car) values (' ');
> insert into ztest (car) values (' ');
> insert into ztest (car) values (' ');
> insert into ztest (car) values (' ');
> insert into ztest (car) values (' ');
> commit;
>
> then
> select Count(*) from ztest
> where car like ' '
> return 1
>
> select Count(*) from ztest
> where car = ' '
> return 6

It is correct, LIKE considers trailing spaces,
while comparisons don't.

Ivan