zoukankan      html  css  js  c++  java
  • SQLServer的smalldatetime 与Datetime的区别

    如下倒子:
    Create  table  chl_test
    ( test1 datetime,
      test2 smalldatetime );

    insert into chl_test values('14:23:28','14:23:28');
    select * from chl_test;

    结果:
             test1                                              test2
    1900-01-01 14:23:28.000                1900-01-01 14:23:00


    在读取该数据时不管你的字段是datetime或smalldatetime读出来的格式都一样(如:1900-01-01)。datetime不会显示出他的毫秒,但是在进行时间比较时他要毫秒就会出现,从而让两个时间段不能相等。

    datetime占8字节,精度3.33毫秒,时间从1753.1.1到9999.12.31  
      smalldatetime占4字节,精度1分钟,时间从1900.1.1到2079.6.6
  • 相关阅读:
    MySQL循环插入语法
    查看linux机子的配置
    extends与implements的不区别
    Git基本命令
    VirtualBox配置 以及文件传输
    zookeeper应用场景
    oracle学习
    linux学习
    Mysql优化
    线程3
  • 原文地址:https://www.cnblogs.com/SALIN/p/767431.html
Copyright © 2011-2022 走看看