select 型号编号 from table2 a,table1 b
where a.机器编号=b.机器编号 and b.机器名称=@MachName

解决方案 »

  1.   

    select 机器名称,型号名称 from table1 t1 inner join table2 t2
    on t1.机器编号=t2.机器编号             
      

  2.   

    select 型号名称 from table2,table1
    where table2.机器编号=table1.机器编号
    and table1.机器名称='aaa'
      

  3.   

    select 型号名称 from table1 inner join table2 on table1.机器编号=table2.机器编号