你是说外键吧?这样写:
Create Table Student(
  ID Integer Not NULL,
  Name VarChar(8) Not NULL,
  Primary Key (ID))
Create Table Book(
  ID Integer Not NULL,
  Name VarChar(240) Not NULL,
  Primary Key(ID))
Create Table Book_Stu(
  StudentID Integer Not NULL,
  BookID Integer Not NULL,
  Primary key(StudentID,BookID),
  Foreign key(StudentID) References (Student),
  Foreign key(BookID) References (Book))
没试过用VFP,你试试吧。

解决方案 »

  1.   

    我的意思是在delphi下的一个query的SQL语句中实现类似vfp的
    set rela to id into tablename
      

  2.   

    select table1.*,table2.* from table1,table2 where table1.公用字段=table2.公用字段
      

  3.   

    VFP不是SQL类型数据库,仅能使用最简单的几个SQL语句。如果要使用Delphi建立关系,估计没法使用set rela to id into tablename的语句,但是你可以构造SQL查询实现类似结果,像楼上的一样。
      

  4.   

    to hnsyf(鱼片儿)
        那么,对vfp表的操作是不是直接用Ttable较好较快呢?
    我发现用SQL是没有vfp自己搞得快