需求

sql 使用 inner 进行多表查询

解决

INNER JOIN 语法:

INNER JOIN 连接两个数据表的用法:
SELECT * FROM 1 INNER JOIN 2 ON 1.字段号=2.字段号

INNER JOIN 连接三个数据表的用法:
SELECT * FROM (1 INNER JOIN 2 ON 1.字段号=2.字段号) INNER JOIN 3 ON 1.字段号=3.字段号

INNER JOIN 连接四个数据表的用法:
SELECT * FROM ((1 INNER JOIN 2 ON 1.字段号=2.字段号) INNER JOIN 3 ON 1.字段号=3.字段号) INNER JOIN 4 ON Member.字段号=4.字段号

INNER JOIN 连接五个数据表的用法:
SELECT * FROM (((1 INNER JOIN 2 ON 1.字段号=2.字段号) INNER JOIN 3 ON 1.字段号=3.字段号) INNER JOIN 4 ON Member.字段号=4.字段号) INNER JOIN 5 ON Member.字段号=5.字段号
"FROM (quality AS q inner join quality_type AS qt ON q.`fk_quality_type__quality` = qt.`key_id`) "
"inner join reagent AS r ON q.`fk_reagent__quality` = r.`key_id` "

参考