I have a list of product collection ids in the form of varchar
datatype.
Referring to a sample structure below.. I would like to retrieve the item names of collection id (pro_col_id) 3453, 3454, 3455.
My query is as follows:
select pro_col_id, name
from collections_table
where pro_col_id in (3453, 3454, 3455);
When I ran this query, I got an error
SQL Error: '=' cannot be applied to varchar, bigint
So I tried to cast pro_col_id
as int like this:
select pro_col_id, name
from collections_table
where cast(pro_col_id as int) in (3453, 3454, 3455);
but I still get the same error. Does anyone know what is the issue causing this?
Thank you!