SQLite的Integer類型


SQLite 中的 INTEGER:帶符號的整型,具體取決有存入數字的范圍大小,根據大小可以使用1,2,3,4,6,8字節來存儲。

在SQLite中,存儲分類和數據類型也有一定的差別,如INTEGER存儲類別可以包含6種不同長度的Integer數據類型,然而這些INTEGER數據一旦被讀入到內存后,SQLite會將其全部視為占用8個字節無符號整型。

INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.

The INTEGER storage class, for example, includes 6 different integer datatypes of different lengths. This makes a difference on disk. But as soon as INTEGER values are read off of disk and into memory for processing, they are converted to the most general datatype (8-byte signed integer).

 

 

不同長度的 Integer 對應的最大、最小值如下圖:

注意, Integer 默認就是 4字節的 int4.

 

image

轉自:

http://zhiwei.li/text/2009/11/sqlite%E6%94%AF%E6%8C%81%E7%9A%84%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/

http://libdbi-drivers.sourceforge.net/docs/dbd_sqlite3/x123.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM