Wang,

select * from t1 where ordno>=' '
gets wrong  result 2 rows

I doubt you'll get many helpful responses till you post the INSERTs.

PB

-----

wang shuming wrote:
Oh,
   If any char fields add to index key ,then the >=' ' gets wrong .

  ordno, qty ,mem
               1
               3
               5
    aaa    18
    bbbbb 20

  1. CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`),
  KEY `key03` (`ordno`))

select * from t1 where ordno>='  '
 gets wrong  result 2 rows

2CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`))

select * from t1 where ordno>='  '
 gets  OK 5 rows

3.CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`),
  KEY `key03` (`mem`))

select * from t1 where mem>='   '
0 rows  wrong

4.CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`))

select * from t1 where mem>='   '
 5 rows OK

Regards!

Shuming wang

------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 8.5.435 / Virus Database: 271.1.1/2721 - Release Date: 03/03/10 19:34:00

Reply via email to