如何将特定索引值添加到枚举中,例如 SQL 中的枚举 ('a'=5,'b',c'=20)。有没有办法做到这一点

How to add specific index values to enum's like enum('a'=5,'b',c'=20) in SQL. Is there any to do this

我想在 mysql 的枚举中分配特定的索引值。像 mysql.

中的 enum('a' = 5, 'b', 'c' =20)

在mysql.

中有什么方法可以做到这一点

谢谢

MySQL不允许指定精确映射,基本上是按顺序映射的。这在类型页面上有描述: https://dev.mysql.com/doc/refman/5.6/en/enum.html