当前位置: 首页 > news >正文

网站质量自建虚拟主机网站源码

网站质量,自建虚拟主机网站源码,网站建设公司的市场定位,网站建设套餐有哪些前言#xff1a;在网上看了很多文章#xff0c;大家都是推荐 MySQL 要慎用 ENUM 字段#xff0c;但是原理感觉还是有点模糊。今天我们就从官网来818这些东西1、关于 ENUM 迁移的问题#xff1f;这里引用别人的一段话#xff1a;但ENUM带来的问题也不少#xff0c;比如数据…前言在网上看了很多文章大家都是推荐 MySQL 要慎用 ENUM 字段但是原理感觉还是有点模糊。今天我们就从官网来818这些东西1、关于 ENUM 迁移的问题这里引用别人的一段话但ENUM带来的问题也不少比如数据迁移的时候他几乎不可能被其他数据库所支持如果 ENUM 里面是字符串对于其他数据库来说就更郁闷了还不能设为tinyint等类型的字段2、关于 ENUM 索引的问题纯数字类型的不建议用枚举类型这是因为在 ENUM 内部维护有一个隐形的索引也是按数字排列的容易混淆添加枚举值也是一个问题如果添加在最后还好如果添加在中间什么位置的话原来的隐藏索引将不再起作用Index Values for Enumeration LiteralsEach enumeration value has an index:The elements listed in the column specification are assigned index numbers, beginning with 1.The index value of the empty string error value is 0. This means that you can use the following SELECT statement to find rows into which invalid ENUM values were assigned:mysql SELECT * FROM tbl_name WHERE enum_col0;The index of the NULL value is NULL.The term “index” here refers to a position within the list of enumeration values. It has nothing to do with table indexes.For example, a column specified as ENUM(Mercury, Venus, Earth) can have any of the values shown here. The index of each value is also shown.ValueIndexNULLNULL0Mercury1Venus2Earth3An ENUM column can have a maximum of 65,535 distinct elements. (The practical limit is less than 3000.) A table can have no more than 255 unique element list definitions among its ENUM and SET columns considered as a group. For more information on these limits, see Section C.10.5, “Limits Imposed by .frm File Structure”.If you retrieve an ENUM value in a numeric context, the column values index is returned. For example, you can retrieve numeric values from an ENUM column like this:mysql SELECT enum_col0 FROM tbl_name;Functions such as SUM() or AVG() that expect a numeric argument cast the argument to a number if necessary. For ENUM values, the index number is used in the calculation.3、ENUM 字段 NULL 值问题ENUM 字段默认是可以插入 NULL 值的这个就比较尴尬了而且没有办法优化4、插入的值问题如果插入的值比ENUM设定的值大会默认保存成接近的那个值插入的值不能包含函数不能传递参数numbers ENUM(0,1,2)mysql INSERT INTO t (numbers) VALUES(2),(2),(3);mysql SELECT * FROM t;---------| numbers |---------| 1 || 2 || 2 |---------所以如果插入的值是数字型的建议用tinyint如果插入的值是字符型的建议用char。如果真想用 ENUM 也是可以得前提是要了解到 ENUM 的弊端就可以有效规避这些问题参考文档:https://dev.mysql.com/doc/refman/5.7/en/enum.html#enum-limits为了方便大家交流本人开通了微信公众号和QQ群291519319。喜欢技术的一起来交流吧
http://wiki.neutronadmin.com/news/292790/

相关文章:

  • 免费红色ppt模板网站wordpress 主题 demo
  • 南通网站建设哪家好wordpress空白页面模板
  • 宝塔面板建设网站石家庄网络推广
  • 小程序网站开发是用什么语言百度惠生活商家怎么入驻
  • 吉林房地产网站开发汕头住房和城乡建设厅网站
  • 分析竞争对手的网站wordpress 首页幻灯片
  • 网站开发w亿玛酷1专注东台建设网站
  • 备案网查询化妆品北京网络seo推广公司
  • 网站源码修复铜陵58同城做网站
  • 网站可以放多少视频高校网站开发
  • 网站空间永久免费扁平式网站
  • 宣城网站优化网站商城建设合同免费下载
  • 章丘哪里做网站网站公司 模板
  • 网站建设售前一般网站的宽度
  • 长沙哪里学网站建设wordpress 清理缩略图
  • 最大的网站模板网wordpress增加内链
  • 电子商务网站开发模块流程图建网站 赚钱
  • 可以做护考题目的网站前端开发工具哪个好
  • 要建立网站和账号违法违规行为数据库和什么黑名单通联支付网络服务股份有限公司
  • 网站开发一个人可以完成吗工商网上核名系统
  • 郑州企业建站公司定制广东网站营销seo方案
  • 请教个人主页网站怎么做啊义乌兼职网站建设
  • 一个公司多个网站做优化网站推广营销技巧
  • 珠海网站定制开发设计公司名字创意
  • 做360手机网站优普通电脑怎么建设网站
  • 东莞机械网站建设网页前端开发流程
  • 服务器上发布网站哈尔滨最专业的网站建设
  • 江苏系统建站怎么用淘宝官方网站登录注册
  • 上海企业网站制作多少钱如归网络营销推广企业
  • 做盗版小说网站犯法吗高大上公司网站