我正在学习“(MySQL) - SET Type”,在Mysql中,我没看懂下面的语句: 链接:The SET Type .
MySQL stores SET values numerically, with the low-order bit of the stored value corresponding to the first set member. If you retrieve a SET value in a numeric context, the value retrieved has bits set corresponding to the set members that make up the column value.
正如他们所说的“数字”,我知道“幕后”有 2 列,1 列是 SET 成员,1 列是二进制系统后面的数值(1、2、4、8、16 等) ..).
我也没有得到这个声明:
If a number is stored into a SET column, the bits that are set in the binary representation of the number determine the set members in the column value. For a column specified as SET('a','b','c','d'), the members have the following decimal and binary values.
大局我不明白 SET 成员在什么值下存储在数据库中,如果有人可以帮助我,我会很高兴,谢谢大家,美好的一天。
最佳答案
SET数据类型值以整数形式存储,SET值('val1','val2'...)以位形式存储;可能有 64 个值 - 8 字节整数。
有一篇关于 SET 类型及其使用的文章 - How to edit values of SET data type .
关于MySQL:SET 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13419653/