标题:[求助]vfp inner join的问题。寻找高人
取消只看楼主
syecho
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-6-10
 问题点数:0 回复次数:0 
[求助]vfp inner join的问题。寻找高人

&&将以下内容复制到.prg文件中,执行,就会发现问题,四个select语句后2个有问题。

set safety off
&&创建 student表
create table student (学号 c(3),姓名 c(6))
insert into student values("001","aaaa")
insert into student values("002","bbbb")
insert into student values("003","cccc")

&&创建 course表
create table course (课程号 c(3),课程名 c(6))
insert into course values("00A","KC01")
insert into course values("00B","KC02")
insert into course values("00C","KC03")

&&创建 score1表
create table score1 (学号 c(3),课程号 c(3),成绩 n(3))
insert into score1 values("001","00A",89)
insert into score1 values("001","00B",79)
insert into score1 values("001","00C",69)
insert into score1 values("002","00A",83)
insert into score1 values("002","00B",73)
insert into score1 values("002","00C",63)
insert into score1 values("003","00A",80)
insert into score1 values("003","00B",70)


&&sql1,正常
SELECT * FROM score1 , course , student WHERE score1.学号 = student.学号 AND score1.课程号 = course.课程号
&&sql2
SELECT * FROM course INNER JOIN score1 INNER JOIN student ON score1.学号 = student.学号 ON score1.课程号 = course.课程号
&&sql3,姓名字段有问题
SELECT * FROM score1 INNER JOIN course INNER JOIN student ON score1.学号 = student.学号 ON score1.课程号 = course.课程号
&&sql4,课程名字段有问题
SELECT * FROM score1 INNER JOIN course INNER JOIN student ON score1.课程号 = course.课程号 ON score1.学号 = student.学号

[此贴子已经被作者于2007-6-13 22:44:17编辑过]

搜索更多相关主题的帖子: vfp inner join 高人 
2007-06-13 22:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-147275-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.293279 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved