查询问题,急急(25分)

  • 主题发起人 主题发起人 wangchengwu
  • 开始时间 开始时间
W

wangchengwu

Unregistered / Unconfirmed
GUEST, unregistred user!
有两个表,一个学生基本情况信息表(Student)有字段Student_ID(学号),Name(姓名)等,另一个学生成绩表(Achievement),有Student_ID(学号)
我做如下查询:
按学生的姓名查询,提示出错,哪位高人能替我解决?
谢谢!THANKS!

Case RadioGroup1.ItemIndex of
0:
with Fdm.AQ_Single do
begin
close;
sql.clear;
SQL.Add('select Achievement.* from Achievement,Student where Student_ID in (SELCECT Student_ID FROM Student where Name like ''%'+Edit1.Text+'%'')');
open;
end;
1:
with Fdm.AQ_Single do
begin
Close;
sql.Clear;
sql.add('select Achievement.* from Achievement,Student where Name in (SELECT Student_ID FROM Student Where Name='''+Edit1.text+''')');
Open;
end;
end;
 
sql.add('select a.* from Achievement a,Student b where a.Student_ID=b.Student_ID and b.Name='''+Edit1.text+'''');
 
接受答案了.
 

Similar threads

A
回复
0
查看
932
Andreas Hausladen
A
A
回复
0
查看
805
Andreas Hausladen
A
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
653
import
I
后退
顶部