zoukankan      html  css  js  c++  java
  • Oracle 常用

    Get MAX Update_timestamp SQL
    SELECT to_char(MAX(update_timestamp), 'yyyymmddhh24miss.sssss') lastUpadateTime 
    FROM t_itemorder 
    WHERE itemorder_num = '184'
    return : 20060123164734.60454

    SELECT to_char(SYSDATE, 'yyyy/mm/dd HH24:MI:SS'FROM dual
    return : 2006/03/01 10:33:17

    Get MAX Update_timestamp Method
            public static string QueryLastUpadateTime(int stockCorrectNum)
            {
                StringBuilder sb 
    = new StringBuilder();
                sb.Append(
    "SELECT MAX(update_timestamp) lastUpadateTime FROM t_stockCorrect ");
                sb.AppendFormat(
    "WHERE stockCorrect_num = {0}", stockCorrectNum);

                
    string sql = sb.ToString();
                
    object obj = OracleHelper.ExecuteScalar(sql);

                
    if (obj == DBNull.Value)
                {
                    
    return "";
                }
                
                
    return ((DateTime)obj).ToString(BaseRecord.TimeFormat);
            }
    return : 20060123164734000
    另:
     public class BaseRecord
     {
            
    private static readonly ILog log = LogManager.GetLogger(typeof(BaseRecord));
            
            
    public static readonly int        NullNumber          = int.MinValue;

            
    public static readonly string    IntegerFormat    = "#,##0";
            
    public static readonly string    DecimalFormat   = "#,##0.00";
            
    public static readonly string    DateFormat         = "yyyyMMdd";
            
    public static readonly string    TimeFormat         = "yyyyMMddHHmmssfff";
    }

    在 DataGrid 中的 DataFormatString 属性
    <asp:BoundColumn HeaderText="UpdateTime" DataField="UpdateTime" DataFormatString="{0:yyyy-MM-dd hh:mm:ss}">
      
    </asp:BoundColumn>
  • 相关阅读:
    PHP全路径无限分类原理
    SecureCRT上传bash: rz: command not found
    Android利用Fiddler进行网络数据抓包【怎么跟踪微信请求】
    Creating the Help Page in ASP.NET Web API
    Windows上怎么安装ELK
    安装ELK
    How to kill a process on a port on linux 怎么杀死 关掉一个端口
    How to install Mysql in the CentOS
    Hadoop: Setup Maven project for MapReduce in 5mn
    Install Ambari 2.2.0 from Public Repositories(Hadoop)
  • 原文地址:https://www.cnblogs.com/publicbill/p/332285.html
Copyright © 2011-2022 走看看