有一列的数据  类型 是  date 存入 数据  2010-04-22
我想将存入 数据格式 设定为 20100422可不可以 ?

解决方案 »

  1.   

    把  一个date数据列  的格式设定为yyyyMMdd
      

  2.   

    select date_format( 处理一下不就行了?
      

  3.   

    set @@date_format = '%Y%m%d';mysql> create table tdate(id date);
    Query OK, 0 rows affected (0.06 sec)mysql> insert into tdate values('20090807');
    Query OK, 1 row affected (0.03 sec)mysql> select * from tdate;
    +------------+
    | id         |
    +------------+
    | 2009-08-07 |
    +------------+
    1 row in set (0.00 sec)mysql>