作/译者:叶金荣(Email: [MySQL优化案例]系列 -- 带函数的查询条件_查询),来源:http://imysql.cn,转载请注明作/译者和出处,并且不能用于商业用途,违者必究。
mysql>explain select * from tbl_name where date_format(EndTime, '%Y-%m-%d') >= '2007-08-08' AND
 date_format(EndTime, '%Y-%m-%d') < '2007-08-09'\G
           id: 1
  select_type: SIMPLE
        table: UserProject
         type: ALL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 1012465
        Extra: Using where
mysql>set @dt='2007-08-08' ; set @dt1 = '2007-08-09';
mysql>explain select * from tbl_name where EndTime >= @dt AND EndTime < @dt1\G
           id: 1
  select_type: SIMPLE
        table: UserProject
         type: range
possible_keys: EndTime
          key: EndTime
      key_len: 8
          ref: NULL
  本文出自 “MySQL中文网”博客 http://www.imysql.cn/