select Student.*,Course.*,Score.* from Score
inner join Student on Student.SId=Score.SId
inner join Course on Course.CId=Score.CId
这是代码,查出三张表全部内容(需要这么做,我知道表.字段),如何把重复的SID,CID 这两列去掉。
select Student.*,Course.*,Score.* from Score
inner join Student on Student.SId=Score.SId
inner join Course on Course.CId=Score.CId
group by Score.SId,Score.CId
select Student.SID,Student.A,Student.B......,Course.CID,Course.A,Course.B,.....,Score.SID,Score.A,Score.B,..... from Score
inner join Student on Student.SId=Score.SId
inner join Course on Course.CId=Score.CId
在上面把所有字段都玩出来就可以了,SID,CID如需要就列上,不需要去掉就可以了