select id, db, user, host, command, time, state, info from information_schema.processlist where db like 'resource_01' order by time desc ;
UNION ALL: 将两张表的数据拼装到一起返回.
联表查询:
1 2 3 4 5 6 7 8 9
SELECT tb_students.id, tb_students.stuName, tb_profession.proName AS stuProfession FROM tb_students, tb_profession WHERE tb_students.stuProfession = tb_profession.id ORDERBY tb_students.id
SELECT tb_profession.*, COUNT(*) AS proCount FROM tb_students INNERJOIN tb_profession ON tb_profession.id = tb_students.stuProfession GROUPBY tb_profession.id