从单表中得到数据
ORDER BY
SELECT
*
FROM
table
WHERE
id = 1
ORDER BY id,name DESC
BETWEEN a AND b(包括a和b)
SELECT
*
FROM
table
WHERE
date BETWEEN '1900-01-01' AND '2000-01-01'
NOT 、AND 、OR
SELECT
*
FROM
table
WHERE
NOT (id>100 AND id<150) OR (id > 100 AND id <150)
这里NOT只影响了OR的前面半句
IN
SELECT
*
FROM
table
WHERE
name in ('a','b','c')
LIKE
SELECT
*
FROM
table
WHERE
name LIKE '%y' or name LIKE '_y'
REGEXP
SELECT
*
FROM
table
WHERE
name REGEXP '^a|p$' OR name REGEXP 'a[wvsdrew]'
IS NULL
SELECT
*
FROM
table
WHERE
phone IS NULL or phone IS NOT NULL
LIMIT
SELECT
*
FROM
table
ORDER by id
LIMIT 6