1
我試圖創建一個臨時表,將原始表中的char(10)數字tkey存儲爲無符號整數。 當它遇到109516列。這將失敗:MySQL嘗試創建具有大整數的臨時表失敗
mysql> CREATE TEMPORARY TABLE IF NOT EXISTS lutemp AS (SELECT cast(tkey as unsigned),ca01,ce01 FROM lu); ERROR 1264 (22003): Out of range value for column 'cast(tkey as unsigned)' at row 109516
但如果我選擇該行作爲轉換成integer,它有沒有問題,這樣做:
mysql> select cast(tkey as unsigned) from lu limit 109515,1; +--------------------------+ | cast(tkey as unsigned) | +--------------------------+ | 4298001000 | +--------------------------+ 1 rows in set (0.10 sec)
我在做什麼錯?
謝謝,非常完美。 --trl – thelma