Hi Pooly, all,

Pooly wrote:
Hi,

I stumbled on one issue yesterday which took me some time to figure out.
the table is :
create table tt ( PCname varchar(5) not null default '');
insert into tt values ('Centaure');

So, by mistake I inserted names which were too long for the field, but
then I tried to do queries on this particular value :
Select * from tt WHERE PCname='Centaure';
which returns obviously no result. How comes the 'Centaure' in the
SELECT is not cut has it is in the INSERT ?

The rules of SQL allow you to compare even such values which you could not assign.

So you may compare values of character string columns of different length, and the SQL specification is that the shorter string is effectively right-padded with blanks before they are compared
(in other words: trailing blanks are insignificant).


HTH,
Joerg

--
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to