• 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>
  • 相关阅读:
    如何让一个浮动垂直居中:两种方式!带来效果~~~~~~
    rgba()和opacity之间的区别(面试题)
    常用浏览器内核!IE,Chrome ,Firefox,Safari,Opera 等内核
    有关Option.inSamplSize 和 Compress 图片压缩
    Android App 启动 Activity 创建解析
     (转)windows一台电脑添加多个git账号
    Handler向子线程发送数据
    Android Touch事件分发
    int 转十六进制
    JVM client模式和Server模式
  • 原文地址:https://www.cnblogs.com/publicbill/p/332285.html
Copyright © 2020-2023  润新知