CAST

Started by Enrico Cominiover 25 years ago2 messagesgeneral
Jump to latest
#1Enrico Comini
algobit@algobit.com

Hi, how I have to change the next query ?

da_kg=Numeric
a_kg =Numeric

cusiodb=# SELECT * FROM tavola_pesi WHERE ((da_kg < 3.5) and (a_kg >= 3.5));
ERROR: Unable to identify an operator '<' for types 'numeric' and 'float8'
You will have to retype this query using an explicit cast

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Enrico Comini (#1)
Re: CAST

Enrico Comini writes:

Hi, how I have to change the next query ?

da_kg=Numeric
a_kg =Numeric

cusiodb=# SELECT * FROM tavola_pesi WHERE ((da_kg < 3.5) and (a_kg >= 3.5));
ERROR: Unable to identify an operator '<' for types 'numeric' and 'float8'
You will have to retype this query using an explicit cast

CAST(3.5 as numeric)

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/