例如:
表xuesheng
id name
1, Jack
2, Tom
3, Kity
4, nono
表kaoshi
id grade
1, 56
2, 76
11, 89
内连接(显示两表匹配的id)
select stu.id, exam.id, stu.name, exam.grade from xuesheng stu inner join kaoshi exam on stu.id = exam.id
结果如下
1 1 Jack 56
2 2 Tom 76