By the way.. I found this snippet. If I read it right, it seems that IGNORING trailing spaces during string comparisons is ANSI standard.
SQL Server follows the ANSI/ISO SQL-92 specification (Section 8.2, <Comparison Predicate>, General rules #3) on how to compare strings with spaces. The ANSI standard requires padding for the character strings used in comparisons so that their lengths match before comparing them. The padding directly affects the semantics of WHERE and HAVING clause predicates and other Transact-SQL string comparisons. For example, Transact-SQL considers the strings 'abc' and 'abc ' to be equivalent for most comparison operations. -----Original Message----- From: Zbigniew Baniewski [mailto:[EMAIL PROTECTED] Sent: Thursday, January 17, 2008 5:20 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] SQLite character comparisons On Thu, Jan 17, 2008 at 10:43:20AM -0500, Fowler, Jeff wrote: > I've used SQL Server for over 15 years, Oracle off & on when I have no > choice, but SQLite for a couple weeks. I've just learned (today) that > SQLite respects trailing spaces when comparing two character fields. > I.e. 'SQLITE' <> 'SQLITE ' > > Is this behavior intentional? Neither SQL Server nor Oracle do this. > Just curious as to why it works this way. PostgreSQL sees the strings that way too: mydbase=> select 'str' = 'str'; ?column? ---------- t (1 row) mydbase=> select 'str' = 'str '; ?column? ---------- f (1 row) Those are different strings, anyway. Can't recall now, does there any setting to change this - but you can easily find out at their website. -- pozdrawiam / regards Zbigniew Baniewski ------------------------------------------------------------------------ ----- To unsubscribe, send email to [EMAIL PROTECTED] ------------------------------------------------------------------------ ----- ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------