HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
MySQL Functions : Convert a value to a DATE datatype
The CONVERT() function converts a value into the specified datatype or character set.
CONVERT(value, type)
OR:
CONVERT(value USING charset)
Parameter | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value | Required. The value to convert | ||||||||||||||||||||
type | Required. The datatype to convert to. Can be one of the following:
|
||||||||||||||||||||
charset | Required. The character set to convert to |
Works in: | From MySQL 4.0 |
---|
Convert a value to a CHAR datatype:
SELECT CONVERT(150, CHAR);
Convert a value to a TIME datatype:
SELECT CONVERT("14:06:10", TIME);
Convert a value to LATIN1 character set:
SELECT
CONVERT("W3C" USING latin1);