文件名称:多表联结查询—内联结--SqlServer教材,基础学习(基础篇)
文件大小:4.56MB
文件格式:PPT
更新时间:2024-05-15 15:55:32
SqlServer
多表联结查询—内联结-1 SELECT S.SName,C.CourseID,C.Score From Score AS C INNER JOIN Students AS S ON C.StudentID = S.SCode StudentsID CourseID Score 1 2 2 3 001 001 002 002 97 89 67 76 3 003 81 Score 猜一猜:这样写,返回的查询结果是一样的吗? SELECT S.SName,C.CourseID,C.Score From Students AS S INNER JOIN Score AS C ON C.StudentID = S.SCode 再猜一猜:以下返回多少行? SELECT S.SName,C.CourseID,C.Score From Students AS S INNER JOIN Score AS C ON C.StudentID <> S.SCode SName 梅超风 陈玄风 陆乘风 曲灵风 SCode 1 2 3 4 Stundents SName 梅超风 陈玄风 陈玄风 陆乘风 CourseID Score 001 001 002 002 97 89 67 76 陆乘风 003 81 查询结果