[摘要]下面小编就为大家带来一篇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运用一个语句就可以查出各种整形占用字节数及最大最小值的示例代码