zoukankan      html  css  js  c++  java
  • 10种数据库获取当前时间/服务器时间(Oracle、Infomix、DB2、SQL Server、Access 、Sybase、MySQL、FoxPro、Sqlite、postgreSQL)

    10种数据库获取当前时间/服务器时间(Oracle、Infomix、DB2、SQL Server、Access 、Sybase、MySQL、FoxPro、Sqlite、postgreSQL)

    1、Oracle数据库:select sysdate from Table1;  

    2、Infomix数据库:select current from sysmaster:sysshmvals;

    3、DB2数据库:select current timestamp from sysibm.sysdummy1

    4、SQL Server数据库:select getdate();

    5、Access 数据库:select * from table1 where Date=" & date()

    6、Sybase数据库:select getdate();

    7、MySQL数据库:select sysdate();    //等同 select now() --yyyy-MM-dd HH:mm:ss      select current_date  --yyyy-MM-dd

    8、FoxPro数据库:select date();

    9、Sqlite数据库:select 1  或 select (datetime('now'))     //select strftime('%Y-%m-%d %H:%M:%f','now') 精确到毫秒,select strftime('%s','now')  时间戳

    10、postgreSQL数据库:select sysdate();

    创建时间:2021.03.30  更新时间:

    博客园 滔Roy https://www.cnblogs.com/guorongtao 希望内容对你所有帮助,谢谢!
  • 相关阅读:
    [转]C++引用
    安装Charles报错
    BigDecimal用法详解
    Map类集合
    Dubbo定义及其作用
    idea常用插件
    GitLab常用命令
    激活idea
    开发微信公众账号报错 返回码详细解释
    微信公众号 iOS UITextFiled 用中文键盘输英文出现空格的解决方法
  • 原文地址:https://www.cnblogs.com/guorongtao/p/14596009.html
Copyright © 2011-2022 走看看