Type Conversion

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 类型转换

| username: TiDBer_Xin

Converting in TiDB like this will turn it into bigint, SELECT CAST(‘20240422’ AS SIGNED). Is there any way to convert it to int? It actually doesn’t exceed the range of int, so why is it converting to bigint?

| username: wakaka | Original post link

Are you converting a string to an int?

| username: TiDBer_Xin | Original post link

Yes, converting like this is fine, but the type he gave me is bigint, and I need int type.

| username: forever | Original post link

Is there any difference for you in using different numeric types?