多少个表别名
  sql.Add('select 房号 from (select 栋号 from dh where 栋号= :栋号) as A 
   where 房号= :房号'); sql.Add('insert into (select 栋号 from dh where 栋号= :栋号1) as A
 (序号,栋号,房号,姓名,类型,面积,单价,缴费状态) values(:序号,:栋号,:房号,:姓名,:类型,:面积,:单价,:缴费状态)');

解决方案 »

  1.   

    sql.Add('select 房号 from (select 栋号 from dh where 栋号= :栋号) where 房号= :房号');这行  子查询里面 的  select 栋号   没有   “房号“ 这个字段吧能查出来么
      

  2.   

    --改一下,在查询出的子表中加入'房号' 
     sql.Add('select 房号 from
     (select 栋号,房号 from dh where 栋号= :栋号) as A 
       where 房号= :房号');