[英]How can I show the zero at the starting of a number in SQL/Sybase?
I want to put two totally different numbers like 01234567890
and 1234567890
So I made this code on SQL/Sybase 我想输入两个完全不同的数字,例如01234567890
和1234567890
所以我在SQL / Sybase上编写了此代码
create table DOCTORS(
document bigint not null ,
);
GO
Insert into DOCTORS values(CONVERT(INT, '01234567890'))
Insert into DOCTORS values(CONVERT(INT, '1234567890'))'
But when I do a select
, it shows me: 但是当我进行select
,它显示了我:
document
--------
1234567890
----------
1234567890
instead of 代替
document
--------
01234567890
----------
123456789
BIGINT values represent a spot on the number line. BIGINT值表示数字线上的一个点。
1234567890 = 01234567890 = 1234567890.000
To make these values differentiate from each other, they cannot be any sort of a numeric data type. 为了使这些值彼此区分,它们不能是任何类型的数字数据类型。
Strings, however, can make this differentiation. 但是,字符串可以使这种区别。
'1234567890' != '01234567890' != '1234567890.000'
Make the data type nvarchar(max) to accomplish the differentiation you seek. 使数据类型为nvarchar(max)以完成您寻求的区分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.