Subject Re: [firebird-support] Odd handling of spaces in WHERE clause?
Author Ivan Prenosil
Trailing spaces are ignored in comparison.
If conforms to SQL standard.

If you need to take trailing spaces into accout, use LIKE:
Select * from Address where (Company LIKE ' ')

Ivan


----- Original Message -----
From: "rjschappe" <rschappe@...>
To: <firebird-support@yahoogroups.com>
Sent: Sunday, June 20, 2004 11:17 AM
Subject: [firebird-support] Odd handling of spaces in WHERE clause?


> I was just testing some queries and to my amazement the following all
> returned the same recordset:
>
> I have one record with a single space " " in their Company name
>
> select * from Address where (Company='')
> Select * from Address where (Company=' ')
> Select * from Address where (Company=' ')
>
> All these queries brought back my single record.... is this normal?
>
> (it is kindof nice not to have to worry about Trimming spaces, but I
> don't want to rely on this behavior and then have it back-fire on me
> later...)
>
> Thanks,
> --Raymond