![]() ![]() |
|||||||||||||||||||
![]() ![]() ![]() ![]() |
|||||||||||||||||||
![]() |
![]() 21.1.3 En quoi la syntaxe SQL de
|
mSQL type | Corresponding MySQL type |
CHAR(len) | CHAR(len)
|
TEXT(len) | TEXT(len) . len is the maximal length.
And LIKE works.
|
INT | INT . With many more options!
|
REAL | REAL . Or FLOAT . Both 4- and 8-byte versions are available.
|
UINT | INT UNSIGNED
|
DATE | DATE . Uses ANSI SQL format rather than mSQL 's own.
|
TIME | TIME
|
MONEY | DECIMAL(12,2) . A fixed-point value with two decimals.
|
Index creation
MySQL
CREATE TABLE
statement.
mSQL
CREATE INDEX
statements.
To insert a unique identifier into a table
MySQL
AUTO_INCREMENT
as a column type
specifier.
mysql_insert_id()
.
mSQL
SEQUENCE
on a table and select the _seq
column.
To obtain a unique identifier for a row
MySQL
PRIMARY KEY
or UNIQUE
key to the table.
mSQL
_rowid
column. Observe that _rowid
may change over time
depending on many factors.
To get the time a column was last modified
MySQL
TIMESTAMP
column to the table. This column is automatically set
to the current date and time for INSERT
or UPDATE
statements if
you don't give the column a value or if you give it a NULL
value.
mSQL
_timestamp
column.
NULL
value comparisons
MySQL
NULL
is always NULL
.
mSQL
mSQL
, NULL = NULL
is TRUE. You
must change =NULL
to IS NULL
and <>NULL
to
IS NOT NULL
when porting old code from mSQL
to MySQL.
String comparisons
MySQL
BINARY
attribute, which causes comparisons to be done according to the
ASCII order used on the MySQL server host.
mSQL
Case-insensitive searching
MySQL
LIKE
is a case-insensitive or case-sensitive operator, depending on
the columns involved. If possible, MySQL uses indexes if the
LIKE
argument doesn't start with a wildcard character.
mSQL
CLIKE
.
Handling of trailing spaces
MySQL
CHAR
and VARCHAR
columns. Use a TEXT
column if this behavior is not desired.
mSQL
WHERE
clauses
MySQL
AND
is evaluated
before OR
). To get mSQL
behavior in MySQL, use
parentheses (as shown below).
mSQL
mSQL
query:
mysql> SELECT * FROM table WHERE a=1 AND b=2 OR a=3 AND b=4;To make MySQL evaluate this the way that
mSQL
would,
you must add parentheses:
mysql> SELECT * FROM table WHERE (a=1 AND (b=2 OR (a=3 AND (b=4))));
Access control
MySQL
mSQL