就是最一般的查询操作呀。如果是Access或SQL server等建议使用ADO组件,  with Query1 do begin
    Close();SQL.Clear;
    SQL.Add('SELECT x,x1,x2 FROM xxx WHERE (x1=x1 and x2=x2)')'
    try
      Open();
    except
      exit;
    end;   
    if not IsEmpty() then begin
       edit1.Text := FieldByName('x').AsString;
       //...........
    end;   
  end;你的意思是要找个人帮你做吗?呵呵

解决方案 »

  1.   

    首先,要谢谢各位,昨天我自己搞定了,原来我的SQL语句不会写,现在写出来,不知还有没有更好的sql语句
    select s.sname,c.cname,sc.grade
    from student s,course c,s_c sc
    where s.sno=sc.sno and sc.cno=c.cno and c.cno in ('001','002') and
          s.sno in  (
                     select s1.sno
                     from s_c s1,s_c s2
                     where s1.sno=s2.sno  and 
                           s1.cno='001'   and   
                           s2.cno='002'      )         
      

  2.   

    grade 属性应该是 s_c表中的,问题中写错了