Select a.x1,a.x2,b.y1 From xtable a,ytable b Where a.x1='" & text1.text & "' And a.x2=b.y1"a 是表xtable的别名 b是ytable的别名 总体的意思是从xtable表中查询x1,x2字段的数据和从ytable查询y1字段的数据 where后面查询条件是要表xtable中的字段x1等于一个值(text1.text)和xtable表中的x2等于ytable表中的y1(a.x2=b.y1用来关联xtable、ytable表的)
这是自身连接的方法 select first.cno,second.cpno from course first,course second where first.cpno=second.cno 是很典型的例子,查询每门课的间接先修课
select * from 【表名】 【别名】
a、b就是表的别名
总体的意思是从xtable表中查询x1,x2字段的数据和从ytable查询y1字段的数据
where后面查询条件是要表xtable中的字段x1等于一个值(text1.text)和xtable表中的x2等于ytable表中的y1(a.x2=b.y1用来关联xtable、ytable表的)
select first.cno,second.cpno from course first,course second where first.cpno=second.cno 是很典型的例子,查询每门课的间接先修课