盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

MySQL使用一个语句就可以查出各种整形占用字节数及最大最小值的示例代码

时间:2025/3/15作者:未知来源:盾怪网教程人气:

[摘要]下面小编就为大家带来一篇MySQL一个语句查出各种整形占用字节数及最大最小值的实例。直接上码:select bigint unsigned as type ,8 as bytes ,~0 as ma...
下面小编就为大家带来一篇MySQL一个语句查出各种整形占用字节数及最大最小值的实例。

直接上码:

select 'bigint unsigned' as type ,'8' as bytes ,~0 as max_num,0 as min_num union
select 'int unsigned','4',~0>>32,0 union
select 'mediumint unsigned','3',~0>>40,0 union
select 'smallint unsigned','2',~0>>48,0 union
select 'tinyint unsigned','1',~0>>56,0 union
select 'signed bigint','8',~0>>1,-(1<<63) union
select 'signed int','4',~0>>33,-(1<<31) union
select 'signed mediumint','3',~0>>41,-(1<<23) union
select 'signed smallint','2',~0>>49,-(1<<15) union
select 'signed tinyint','1',~0>>57,-(1<<7);

+--------------------+-------+----------------------+----------------------+

关键词:MySQL运用一个语句就可以查出各种整形占用字节数及最大最小值的示例代码




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版