The following are useful extensions in MySQL that you probably will not find in other SQL databases. Be warned that if you use them, your code will not be portable to other SQL servers.
MEDIUMINT, SET, ENUM and the
different BLOB and TEXT types.
AUTO_INCREMENT, BINARY,
UNSIGNED and ZEROFILL.
BINARY attribute.
INTO OUTFILE and STRAIGHT_JOIN in a SELECT
statement. See section SELECT syntax.
EXPLAIN SELECT to get a description on how tables are joined.
INDEX or KEY in a CREATE TABLE
statement. See section CREATE TABLE syntax.
DROP column or CHANGE column in an ALTER TABLE
statement. See section ALTER TABLE syntax.
LOAD DATA INFILE. This syntax is in many cases compatible with
Oracle's LOAD DATA INFILE. See section LOAD DATA INFILE syntax.
" instead of ' to enclose strings.
\ character.
SET OPTION statement. See section SET OPTION syntax.
GROUP BY part.
See section Functions for GROUP BY clause.
|| and && operators are, in MySQL, synonyms for
OR and AND, like in the C programming language.
Likewise | and & stand for bitwise OR and
AND. Because of this nice syntax, MySQL doesn't support
the ANSI SQL operator || for string concatenation, one has to use
CONCAT() instead. As CONCAT() takes any number
of arguments it's easy to convert use of the || operator to
MySQL.
CREATE DATABASE or DROP DATABASE.
See section Create database syntax.
% instead of mod(). % is supported for C programmers and
for compatibility with PostgreSQL.
=, <>, <= ,<, >=,>, AND,
OR, or LIKE in a column statement
LAST_INSERT_ID.
See section How can I get the unique ID for the last inserted row?
REGEXP or NOT REGEXP.
CONCAT() or CHAR() with one or more than two arguments. In
MySQL the above functions can take any number of arguments.
BIT_COUNT(), ELT(), FROM_DAYS(), FORMAT(),
IF(), PASSWORD(), ENCRYPT(),
PERIOD_ADD(), PERIOD_DIFF(), TO_DAYS(),
or WEEKDAY().
TRIM to trim substrings. ANSI SQL only supports removal
of single characters.
STD(), BIT_OR and BIT_AND group functions.
MIN() or MAX() as normal functions, not only group
functions.
REPLACE instead of DELETE + INSERT.
See section REPLACE syntax
Go to the first, previous, next, last section, table of contents.