2007-02-13

型別/類型轉換(Type Conversion)

對映章節:C.10

1.
2.用戶自定義:CREATE CAST
內建類型類型轉換集已經經過仔細的雕琢了,不要去變更它們。

---------------------------------------------------
取時間到小數第6位
# select cast(current_timestamp as timestamp);
or
# SELECT current_timestamp::timestamp;

now
----------------------------
2007-02-13 08:55:14.269532
(1 row)


轉成字串只取小數六位
'US':微秒
#select to_char(current_timestamp, 'US');
to_char
---------
512888
(1 row)


http://www.postgresql.org/docs/8.2/interactive/functions-formatting.html

沒有留言:

張貼留言