MySQL中的BIT和TINYINT有什么区别? [英] What is the difference between BIT and TINYINT in MySQL?

查看:633
本文介绍了MySQL中的BIT和TINYINT有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪种情况下,您会使用哪种?有什么区别吗?持久性引擎通常使用哪一个来存储布尔值?

In which cases would you use which? Is there much of a difference? Which I typically used by persistence engines to store booleans?

推荐答案

TINYINT是一个8位整数值,BIT字段可以存储1位BIT(1)和64位BIT(64)之间.对于布尔值,BIT(1)很常见.

A TINYINT is an 8-bit integer value, a BIT field can store between 1 bit, BIT(1), and 64 bits, BIT(64). For a boolean values, BIT(1) is pretty common.

这篇关于MySQL中的BIT和TINYINT有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆