zoukankan      html  css  js  c++  java
  • MySQL DATE类型

    mysql> use test;
    Database changed
    mysql> create table teacher(birthday DATE);
    Query OK, 0 rows affected (0.24 sec)
    
    mysql> desc teacher;
    +----------+------+------+-----+---------+-------+
    | Field    | Type | Null | Key | Default | Extra |
    +----------+------+------+-----+---------+-------+
    | birthday | date | YES  |     | NULL    |       |
    +----------+------+------+-----+---------+-------+
    1 row in set (0.87 sec)
    
    # 以'-'作为分隔符
    mysql> insert into teacher values('1972-09-23');
    Query OK, 1 row affected (0.07 sec)
    
    # 以'@'作为分隔符
    mysql> insert into teacher values('1981@4@12');
    Query OK, 1 row affected (0.05 sec)
    
    # 以'/'作为分隔符
    mysql> insert into teacher values('1987/8/17');
    Query OK, 1 row affected (0.00 sec)
    
    mysql> insert into teacher values(20080808);
    Query OK, 1 row affected (0.04 sec)
    
    mysql> select * from teacher;
    +------------+
    | birthday   |
    +------------+
    | 1972-09-23 |
    | 1981-04-12 |
    | 1987-08-17 |
    | 2008-08-08 |
    +------------+
    4 rows in set (0.00 sec)
    
    mysql>
  • 相关阅读:
    _#【命名】 / _
    _#【插件】
    _#【命名】样式类
    linux dd命令
    python urllib2和urllib的区别
    hadoop的find
    hadoop的fs基本命令
    /etc/profile和 . profile 文件
    广告sdk
    linux下查找文件的常用命令
  • 原文地址:https://www.cnblogs.com/Robotke1/p/3054864.html
Copyright © 2011-2022 走看看