| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 940 人关注过本帖
标题:[求助]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
快速回复:[求助]vfp inner join的问题。寻找高人
数据加载中...
 
   



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

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