Syntax
CAST(scalar_expression AS datatype[(n)])
CAST
Required
scalar_expression
Required. The item that is to be cast. Column name.
AS
Required
datatype
Required. The supported SQL92 datatype.
n
Length if applicable.
top
Example
select amount,
cast(orders.amount as DOUBLE PRECISION)
from orders where status='cncl'
select order_date,
cast(substring(order_date from 1 for 2) as INTEGER)
from orders
where status='back'
top
|