1.从stuClass,和studentScore两个表中同时查询下面字段:1)表stuClass中的claID/claName/表studentScore中的stuName.
select stuClass.claID,stuClass.claName,studentScore.stuName from stuClass,studentScore
2.为省略可以把表stuClass换成a,把表studentScore换成b,即给表设别名。具体设法如下:
select a.claID, a.claName,b.stuName from stuClass as a ,studentScore as b
3.同理,给列设别名:
select a.claID as 编号 ,a.claName as 班级名, b.stuName as 姓名 from stuClass as a,studentScore as b
注意,这里的所有的as都可去掉
select a.claID 编号 ,a.claName 班级名, b.stuName 姓名 from stuClass a,studentScore b
--列也可以用等号代替as,当然也可以不用。
阅读(1012) | 评论(0) | 转发(0) |