如何学生老班和学生新班 [英] How can Facth Student Old Class And Student New Class
本文介绍了如何学生老班和学生新班的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
学生表
----------------
Student table
----------------
StudentId StudentCode Student Name Address Class
1 001 kkp noida ClassI
2 002 kkpoi Delhi ClassII
3 003 kkpooi mohali ClassIV
Prometed Class Table
------------------------
Prometed Class Table
------------------------
PrometedId NewClassId
1 ClassII
2 ClassIII
学生证书课程表
------------------------------
Student Prometed Class Table
------------------------------
StuPromid PrometedId StudentId
1 1 1
2 1 2
3 2 1
输出可以这个
---------------------
Output can this one
---------------------
StudentName OldClass NewClass
kkp ClassI ClassII
kkpoi ClassII ClassIII
kkpooi ClassIV Null
推荐答案
您需要加入3个表并获得所需的输出。例如
You need to join 3 tables and get the output you want. for example
SELECT a.au_lname, a.au_fname, t.title
FROM authors a INNER JOIN titleauthor ta
ON a.au_id = ta.au_id JOIN titles t
ON ta.title_id = t.title_id
明智的你可以加入多个表格,请阅读以下链接以获取更多信息
SQL联接 [ ^ ]
加入三个或更多表 [ ^ ]
这篇关于如何学生老班和学生新班的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文