本文介绍了从三个不同的表中获得结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有三个不同的表,
课程编号课程名称-table1
纸张ID纸张名称-table2
课程编号Paper id-table3
i have three different tables,
course no Course name - table1
paper id paper name - table2
Course no Paper id - table3
how do i get the corresponding paper names using the course id?
推荐答案
select table3.course_no,table2.paper_name
from table2 inner join table3
on table2.Paper_id=table3.Paper_id
where on table3.course_no= '2'
SELECT tb2.paperName
FROM
table2 as tb2
INNER JOIN
table3 as tb3
WHERE tb2.paperID = tb3.PaperID
AND tb3.CourseNo = --Any value
您没有正确遵循命名约定.
请尝试实现它,并正确命名您的表和字段.
You are not following naming conventions properly.
Please try to implement that and name your tables and fields properly.
这篇关于从三个不同的表中获得结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!