I have the following query where shopname is stored as varbinary instead of varchar type.
select shopname, itemname
from shop_profile
where cast(shopname as varchar) = 'Starbucks';
This query returns an error "line 4:7: Cannot cast varbinary to varchar"
May I know if anyone knows what is the correct syntax to convert varbinary to varchar?
You can use from_utf8 function.
Also, to_utf8 can cast the literal 'Starbucks' to varbinary type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With