Why does sql query give more results than expected?
create table public.test (
id varchar(255),
card_id varchar(255)
);
insert into test values (1, '90000000021981051');
insert into test values (2, '90000000021981058');
insert into test values (3, '9000000002198105');
select card_id
from test
where card_id=90000000021981051;
90000000021981051
90000000021981058
select card_id
from test
where card_id='90000000021981051';
90000000021981051
Does this make sense?
0
Comments
Hmm. I personally never rely on implicit data conversion. I'd recommend an explicit data conversion...
Take a look at the "Data Type Coercion Chart":
https://my.vertica.com/docs/9.1.x/HTML/index.htm#Authoring/SQLReferenceManual/DataTypes/DataTypeCoercionChart.htm
Looks like Vertica is converting to a FLOAT, an "approximate" numeric type!