56,687
社区成员
发帖
与我相关
我的任务
分享
mysql> create table unsigned_test(end_id integer unsigned,start_id integer unsig
ned);
Query OK, 0 rows affected (0.16 sec)
mysql> insert into unsigned_test values(0,15);
Query OK, 1 row affected (0.03 sec)
mysql> select * from unsigned_test;
+--------+----------+
| end_id | start_id |
+--------+----------+
| 0 | 15 |
+--------+----------+
1 row in set (0.00 sec)
mysql> select end_id,start_id,(end_id-start_id) from unsigned_test;
+--------+----------+----------------------+
| end_id | start_id | (end_id-start_id) |
+--------+----------+----------------------+
| 0 | 15 | 18446744073709551601 |
+--------+----------+----------------------+
1 row in set (0.02 sec)
mysql> select cast(0 as unsigned)-15;
+------------------------+
| cast(0 as unsigned)-15 |
+------------------------+
| 18446744073709551601 |
+------------------------+
1 row in set (0.00 sec)