分享知识的快乐,尊重他人创造的知识 注册 | 登陆
浏览模式: 标准 | 列表Tag:int

ACCESS的数字类型与MSSQL对应关系

ACCESS类型 MSSQL
是否 bit
数字(字节) tinyint
数字(整型) smallint
数字(长整形) int
数字(单精度) real
数字(双精度) float
无等价类型 bigint

» 阅读全文

Tags: access, mssql, int, datatype

数据库用Int字段,保存多项选择的结果

今天在设计数据库的时候遇到一个 三个选项 组合选择的结果保存的问题。
一开始想用 字符串分隔的方式。
后来想想是不是可以用 int字段。
于是向lamking 请教一下。他说用数字电路 二进制的思路可以解决。

» 阅读全文

Tags: 二进制, 与运算, int, 多项选择

mysql 数字类型的 int(3)或int(1) 其中括号数字表示什么

mysql 数字类型的 int(3)或int(1) 其中括号数字表示什么.
官方有一段话:

Another extension is supported by MySQL for optionally specifying the display width of integer data types in parentheses following the base keyword for the type (for example, INT(4)). This optional display width is used to display integer values having a width less than the width specified for the column by left-padding them with spaces.

The display width does not constrain the range of values that can be stored in the column, nor the number of digits that are displayed for values having a width exceeding that specified for the column. For example, a column specified as SMALLINT(3) has the usual SMALLINT range of -32768 to 32767, and values outside the range allowed by three characters are displayed using more than three characters.

When used in conjunction with the optional extension attribute ZEROFILL, the default padding of spaces is replaced with zeros. For example, for a column declared as INT(5) ZEROFILL, a value of 4 is retrieved as 00004. Note that if you store larger values than the display width in an integer column, you may experience problems when MySQL generates temporary tables for some complicated joins, because in these cases MySQL assumes that the data fits into the original column width.

» 阅读全文

Tags: mysql, int, number type