<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ### 淺談 PostgreSQL 類型轉換 類似Oracle ,PostgreSQL也有強大的類型轉換函數, 下面僅舉兩個類型轉換例子。 ?????? **--1 例子 **postgres=# select 1/4; ??column?? ---------- ??????? 0 (1 row) ?????? ?在PG里如果想做除法并想保留小數,用上面的方法卻行不通,因為"/" 運算結果為取整,并 且會截掉小數部分。 ? **--2 類型轉換 **postgres=# select round(1::numeric/4::numeric,2); ?round? ------- ? 0.25 (1 row) ? 備注:類型轉換后,就能保留小數部分了。 **--3 也可以通過 cast 函數進行轉換 **postgres=# select round( cast ( 1 as numeric )/ cast( 4 as numeric),2); ?round? ------- ? 0.25 (1 row) **--4 關于 cast 函數的用法 **postgres=# SELECT substr(CAST (1234 AS text), 3,1); ?substr? -------- ?3 (1 row) **--5 附: PostgreSQL 類型轉換函數** FunctionReturn TypeDescriptionExample to_char (timestamp, text ) text convert time stamp to string to_char(current_timestamp, 'HH12:MI:SS') to_char ( interval, text ) text convert interval to string to_char(interval '15h?2m?12s', 'HH24:MI:SS') to_char ( int, text ) text convert integer to string to_char(125, '999') to_char ( double precision , text ) text convert real/double precision to string to_char(125.8::real, '999D9') to_char ( numeric, text ) text convert numeric to string to_char(-125.8, '999D99S') to_date (text, text ) date convert string to date to_date('05?Dec?2000', 'DD?Mon?YYYY') to_number ( text, text ) numeric convert string to numeric to_number('12,454.8-', '99G999D9S') to_timestamp ( text, text ) timestamp with time zone convert string to time stamp to_timestamp('05?Dec?2000', 'DD?Mon?YYYY') to_timestamp ( double precision ) timestamp with time zone convert Unix epoch to time stamp to_timestamp(1284352323)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看