从三个不同的表中获得结果 [英] obtaining the result from three different tables

查看:70
本文介绍了从三个不同的表中获得结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个不同的表,

课程编号课程名称-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?

推荐答案

尝试下面的代码...
如果您只想要课程,则不提供论文名称..

try below code...
if you want only course no ans paper name..

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.


这篇关于从三个不同的表中获得结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆