MySQL joint inquiry, paging query

UNION joint inquiry

Union joint merger: the results of multiple queries as a result of the merger

  • Feature
    • It requires a lot of queries consistent queries column
    • The same type and sequence of queries require multiple queries each column
    • UNION default deduplication, UNION ALL may contain duplicates
# 查询部门编号大于90或者名字包含a的员工信息
SELECT * FROM employees WHERE name like '%a%'
UNION
SELECT * FROM employees WHERE department_i

Paging query

# 格式
SELECT 查询列表
FROM 表
LIMIT offset,size
#offset从0开始
#如果只有一个数字默认是size
#查询员工信息的第五到十行信息
SELECT * FROM employees
LIMIT 4,6;

Guess you like

Origin www.cnblogs.com/redo19990701/p/11286693.html
Recommended