SQL问题,紧急求救!!!(100分)

  • 主题发起人 主题发起人 star_survior
  • 开始时间 开始时间
S

star_survior

Unregistered / Unconfirmed
GUEST, unregistred user!
实现从nklesson_plan中选出Lesson_id(多个),利用Lesson_id在nklesson中选出teacher_id。
我的实现:
select teacher_id from nklesson where nklesson.Lesson_id in (select Specialty_id,Class_con,Lesson_id,Term_id,Week_time
from nklesson_plan
where (Specialty_id=:Specialtyid) and (Grade=:Grade) and (Term_id=:Termid))
错误提示:Invalid use of keyword,Token:,class_con,Lesson_id,
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=998553
为什么又写一遍!
 
Lesson_id in (只能选类型匹配的一个字段,多个不行
 
select teacher_id from nklesson where nklesson.Lesson_id in (select Lesson_id
from nklesson_plan
where (Specialty_id=:Specialtyid) and (Grade=:Grade) and (Term_id=:Termid))

你得这个子select语句只能选择一个字段,就是所需值得范围得那个字段。
 
问题:SQL问题,紧急求救!!! ( 积分:0, 回复:3, 阅读:21 )
分类:数据库-文件型 ( 版主:cAkk, 吴剑明 )
来自:star_survior, 时间:2002-3-23 14:39:00, ID:998553 [显示:小字体 | 大字体]
实现从nklesson_plan中选出Lesson_id(多个),利用Lesson_id在nklesson中选出teacher_id。
我的实现:
select teacher_id from nklesson where nklesson.Lesson_id in (select Specialty_id,Class_con,Lesson_id,Term_id,Week_time
from nklesson_plan
where (Specialty_id=:Specialtyid) and (Grade=:Grade) and (Term_id=:Termid))
错误提示:Invalid use of keyword,Token:,class_con,Lesson_id,

版主功能: 编辑 | 加推荐值 | 减推荐值 | 进黑名单 | 出黑名单

来自:star_survior, 时间:2002-3-23 14:53:00, ID:998569 | 编辑
100分求教[:D]


来自:完颜康, 时间:2002-3-23 14:58:00, ID:998579 | 编辑
>>where nklesson.Lesson_id in (select Specialty_id,Class_con,Lesson_id,Term_id,Week_time
from nklesson_plan
这里有问题,
lesson_id in (select lesson_id where.... )
~~~~~~~~~~~~~~~~~~~~~~
lesson_id 不能同时包含与几列



来自:shangshang, 时间:2002-3-23 15:06:00, ID:998591 | 编辑
不好意思,我刚才只看了你得那个最新的。没看见这个。[8D]


 
多人接受答案了。
 
楼上写的正确!

你的错误有可能在其他地方还存在!
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
951
SUNSTONE的Delphi笔记
S
Y
回复
3
查看
588
yedixifeng
Y
后退
顶部