In MySQL, CHARSET()
is a built in function that returns the character set of its string argument.
We provide the string when we call the function.
Continue readingIn MySQL, CHARSET()
is a built in function that returns the character set of its string argument.
We provide the string when we call the function.
Continue readingIf you’re getting an error in MySQL that reads something like “ERROR 1054 (42S22): Unknown column ‘c.DogName’ in ‘on clause”“, here are three likely causes:
The following is a list of date and time functions available in MySQL. Click on each function name to see an explanation of the function, its syntax, and examples.
Continue readingIn MySQL, CONVERT()
is a built in function that converts a value to another data type. It takes a value of one type and returns a value of the specified type.
We provide the value as an argument when we call the function, as well as the type that we want it converted to.
The CONVERT()
function is similar to the CAST()
function, which also converts between data types.
In MySQL, ROW_COUNT()
is a built-in function that returns the number of rows updated, inserted, or deleted by the preceding statement.
The value returned by ROW_COUNT()
is often the same as the row count that the mysql
client displays following statement execution, as well as the value from the mysql_affected_rows()
C API function.
In MySQL, FORMAT_BYTES()
is a built in function that converts a numeric byte count to a more human-readable format. It returns a string consisting of the value and a units indicator.
We provide the numeric byte count when we call the function.
Continue readingIf you’re getting error number 1064 that reads something like “1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘INTEGER )’ at line 1“, it could be that you’re using the wrong term for the integer.
MySQL doesn’t let us use just the INTEGER
keyword when converting to an integer. We need to use either SIGNED
or UNSIGNED
, optionally followed by INTEGER
or INT
. When we do this, it produces a signed or unsigned BIGINT
value.
Here are seven ways to check what version of MySQL you’re running.
Continue readingIn MySQL, VERSION()
is a built-in function that returns the MySQL server version.
The result is a string that uses the utf8mb3
character set. A suffix may also be appended to the version number indicating server build or configuration information.
The following table contains a full list of format specifiers that can be used in format strings with functions like DATE_FORMAT()
, STR_TO_DATE()
, and FROM_UNIXTIME()
in MySQL.