AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
SQL CONVERT Function |
|
SQL > SQL String Functions >
CONVERT Function
The CONVERT function in MySQL and SQL Server converts data from one data type to another. The SQL CONVERT function lets you change a value's data type — for example, converting a float to an integer — with slightly different syntax depending on the database (MySQL vs. SQL Server vs. Oracle).
SyntaxThe syntax of the CONVERT function is as follows: where [data type] is a valid data type in the RDBMS you are working with. ExampleWe use the following table for our example. Table Student_Score
This table contains the following rows: Table Student_Score
The SQL statement, produces the following result set:
CONVERT function in OracleIn Oracle, the CONVERT function is used differently. It converts a string from one character set to another. Syntax in OracleFrequently Asked QuestionsQ: What does the SQL CONVERT function do? Q: How is CONVERT different from CAST? Q: Can CONVERT truncate decimal values? Q: Is CONVERT available in all SQL databases? |
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.