bigint.result
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:6k
源码类别:

MySQL数据库

开发平台:

Visual C++

  1. drop table if exists t1;
  2. select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
  3. 0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296
  4. 0 256 65536 2147483647 -2147483648 2147483648 4294967296
  5. select 9223372036854775807,-009223372036854775808;
  6. 9223372036854775807 -009223372036854775808
  7. 9223372036854775807 -9223372036854775808
  8. select +9999999999999999999,-9999999999999999999;
  9. 9999999999999999999 -9999999999999999999
  10. 9999999999999999999 -10000000000000000000
  11. select cast(9223372036854775808 as unsigned)+1;
  12. cast(9223372036854775808 as unsigned)+1
  13. 9223372036854775809
  14. select 9223372036854775808+1;
  15. 9223372036854775808+1
  16. 9223372036854775809
  17. select -(0-3),round(-(0-3)), round(9999999999999999999);
  18. -(0-3) round(-(0-3)) round(9999999999999999999)
  19. 3 3 10000000000000000000
  20. select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001;
  21. 1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001
  22. 1 11 101 1001 10001 100001 1000001 10000001 100000001 1000000001 10000000001 100000000001 1000000000001 10000000000001 100000000000001 1000000000000001 10000000000000001 100000000000000001 1000000000000000001 10000000000000000001
  23. select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
  24. -1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000001
  25. -1 -11 -101 -1001 -10001 -100001 -1000001 -10000001 -100000001 -1000000001 -10000000001 -100000000001 -1000000000001 -10000000000001 -100000000000001 -1000000000000001 -10000000000000001 -100000000000000001 -1000000000000000001 -10000000000000000000
  26. select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16);
  27. conv(1,10,16) conv((1<<2)-1,10,16) conv((1<<10)-2,10,16) conv((1<<16)-3,10,16) conv((1<<25)-4,10,16) conv((1<<31)-5,10,16) conv((1<<36)-6,10,16) conv((1<<47)-7,10,16) conv((1<<48)-8,10,16) conv((1<<55)-9,10,16) conv((1<<56)-10,10,16) conv((1<<63)-11,10,16)
  28. 1 3 3FE FFFD 1FFFFFC 7FFFFFFB FFFFFFFFA 7FFFFFFFFFF9 FFFFFFFFFFF8 7FFFFFFFFFFFF7 FFFFFFFFFFFFF6 7FFFFFFFFFFFFFF5
  29. create table t1 (a bigint unsigned not null, primary key(a));
  30. insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
  31. select * from t1;
  32. a
  33. 18446744073709551612
  34. 18446744073709551613
  35. 18446744073709551614
  36. 18446744073709551615
  37. select * from t1 where a=18446744073709551615;
  38. a
  39. 18446744073709551615
  40. delete from t1 where a=18446744073709551615;
  41. select * from t1;
  42. a
  43. 18446744073709551612
  44. 18446744073709551613
  45. 18446744073709551614
  46. drop table t1;
  47. create table t1 ( a int not null default 1, big bigint );
  48. insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615);
  49. select min(big),max(big),max(big)-1 from t1;
  50. min(big) max(big) max(big)-1
  51. -1 9223372036854775807 9223372036854775806
  52. select min(big),max(big),max(big)-1 from t1 group by a;
  53. min(big) max(big) max(big)-1
  54. -1 9223372036854775807 9223372036854775806
  55. alter table t1 modify big bigint unsigned not null;
  56. select min(big),max(big),max(big)-1 from t1;
  57. min(big) max(big) max(big)-1
  58. 12345678901234567 18446744073709551615 18446744073709551614
  59. select min(big),max(big),max(big)-1 from t1 group by a;
  60. min(big) max(big) max(big)-1
  61. 12345678901234567 18446744073709551615 18446744073709551614
  62. alter table t1 add key (big);
  63. select min(big),max(big),max(big)-1 from t1;
  64. min(big) max(big) max(big)-1
  65. 12345678901234567 18446744073709551615 18446744073709551614
  66. select min(big),max(big),max(big)-1 from t1 group by a;
  67. min(big) max(big) max(big)-1
  68. 12345678901234567 18446744073709551615 18446744073709551614
  69. alter table t1 modify big bigint not null;
  70. select min(big),max(big),max(big)-1 from t1;
  71. min(big) max(big) max(big)-1
  72. -1 9223372036854775807 9223372036854775806
  73. select min(big),max(big),max(big)-1 from t1 group by a;
  74. min(big) max(big) max(big)-1
  75. -1 9223372036854775807 9223372036854775806
  76. drop table t1;
  77. create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999;
  78. insert into t1 values (null,1);
  79. select * from t1;
  80. id a
  81. 9999999999 1
  82. select * from t1 limit 9999999999;
  83. id a
  84. 9999999999 1
  85. drop table t1;
  86. CREATE TABLE t1 ( quantity decimal(60,0));
  87. insert into t1 values (10000000000000000000);
  88. insert into t1 values (10000000000000000000.0);
  89. insert into t1 values ('10000000000000000000');
  90. select * from t1;
  91. quantity
  92. -8446744073709551616
  93. 10000000000000000000
  94. 10000000000000000000
  95. drop table t1;
  96. SELECT '0x8000000000000001'+0;
  97. '0x8000000000000001'+0
  98. 0
  99. create table t1 (
  100. value64  bigint unsigned  not null,
  101. value32  integer          not null,
  102. primary key(value64, value32)
  103. );
  104. create table t2 (
  105. value64  bigint unsigned  not null,
  106. value32  integer          not null,
  107. primary key(value64, value32)
  108. );
  109. insert into t1 values(17156792991891826145, 1);
  110. insert into t1 values( 9223372036854775807, 2);
  111. insert into t2 values(17156792991891826145, 3);
  112. insert into t2 values( 9223372036854775807, 4);
  113. select * from t1;
  114. value64 value32
  115. 9223372036854775807 2
  116. 17156792991891826145 1
  117. select * from t2;
  118. value64 value32
  119. 9223372036854775807 4
  120. 17156792991891826145 3
  121. select * from t1, t2 where t1.value64=17156792991891826145 and
  122. t2.value64=17156792991891826145;
  123. value64 value32 value64 value32
  124. 17156792991891826145 1 17156792991891826145 3
  125. select * from t1, t2 where t1.value64=17156792991891826145 and
  126. t2.value64=t1.value64;
  127. value64 value32 value64 value32
  128. 17156792991891826145 1 17156792991891826145 3
  129. select * from t1, t2 where t1.value64= 9223372036854775807 and
  130. t2.value64=9223372036854775807;
  131. value64 value32 value64 value32
  132. 9223372036854775807 2 9223372036854775807 4
  133. select * from t1, t2 where t1.value64= 9223372036854775807 and
  134. t2.value64=t1.value64;
  135. value64 value32 value64 value32
  136. 9223372036854775807 2 9223372036854775807 4
  137. drop table t1, t2;