<rp id="wnpn7"><ruby id="wnpn7"></ruby></rp>
<progress id="wnpn7"><track id="wnpn7"><rt id="wnpn7"></rt></track></progress>
<ruby id="wnpn7"></ruby>
<ruby id="wnpn7"><blockquote id="wnpn7"><div id="wnpn7"></div></blockquote></ruby>

    1. <em id="wnpn7"><ruby id="wnpn7"><input id="wnpn7"></input></ruby></em>
      1. <button id="wnpn7"><acronym id="wnpn7"></acronym></button><button id="wnpn7"><acronym id="wnpn7"></acronym></button>

        <rp id="wnpn7"><acronym id="wnpn7"></acronym></rp>

        <li id="wnpn7"><object id="wnpn7"><u id="wnpn7"></u></object></li>
        VB.net 2010 視頻教程 VB.net 2010 視頻教程 python基礎視頻教程
        SQL Server 2008 視頻教程 c#入門經典教程 Visual Basic從門到精通視頻教程
        當前位置:
        首頁 > 數據庫 > SQL教程 >
        • sql教程之計算經歷的時間

        本站最新發布    SQL Server 2016數據庫視頻教程

        試聽地址   http://www.squ68.com/eschool/SQLxin3721/

        參考實例:

         

        復制代碼
        --定義變量
        DECLARE @startTime DATETIME
        DECLARE @endTime DATETIME
        DECLARE @HOUR INT
        DECLARE @MINUTE INT
        DECLARE @SECOND INT
        DECLARE @Minutes VARCHAR
        
        --為變量賦值
        SET @startTime = '2020-02-10 08:30:00'
        SET @endTime = '2020-02-19 17:10:09'
         
        SET @HOUR = DATEDIFF(HOUR, @startTime, @endTime)
        SET @MINUTE = DATEDIFF(MINUTE, @startTime, @endTime)
        SET @SECOND = DATEDIFF(SECOND, @startTime, @endTime)
        SET @Minutes = CASE WHEN DATEPART(SECOND, @endTime) >= DATEPART(SECOND, @startTime)
                            THEN CAST((@MINUTE % 60) AS VARCHAR)
                            ELSE
                            CAST((DATEDIFF(MINUTE, DATEADD(MINUTE, -1, @endTime), @endTime) % 60) AS VARCHAR)
                            END
        
        --SELECT
        SELECT  [DD:HH:MM:SS] = CAST((@HOUR / 24) AS VARCHAR) +':'+ CAST((@HOUR % 24) AS VARCHAR) +':'+ @Minutes + ':' + CAST((@SECOND % 60) AS VARCHAR),
                [字符串格式] = CAST((@HOUR / 24) AS VARCHAR) +N''+ CAST((@HOUR % 24) AS VARCHAR) +N'小時 ' + @Minutes + N'分鐘 ' + CAST((@SECOND % 60) AS VARCHAR) + N''
        復制代碼

         

        相關教程
                
        免费看成年人视频大全_免费看成年人视频在线观看