Mysql convert to integer.

Cast function used to convert to integer.

Syntax:
SELECT cast(column as datatype)
Examples:
SELECT E.CODE, E.EMPNUMBER, 
E.CURADDRESS1 ADDRESS FROM EMPLOYEEMAS E  
LEFT OUTER JOIN CITYMAS C  ON C.CODE = E.CurCityCode
ORDER BY cast(E.EmpNumber as UNSIGNED INTEGER)
Result:

Post a Comment

0 Comments