
CAST can be used to change the data type of an expression to a different data type or the same data type with a different length, precision, or scale.
SELECT EMPNO, CAST(SALARY AS INTEGER)
FROM Samples.EMP;
The specified data type if DB2 not supported, DB2 will through an error.
Columnar Functions:
DECIMAL(BONUS) is equal to :-
SELECT EMPNO, CAST(BONUS AS DECIMAL(10,2))
FROM Samples.EMP;
You must be logged in to post a comment.