select * from 数据表 where down_class=(select class_name  from 类型表 where class_fid = 2)

解决方案 »

  1.   

    #1241 - Subquery returns more than 1 row
     还是解决不了问题  :(  谢谢楼上的回答
      

  2.   

    你的where class_fid = 2条件查询返回多条记录
    不能用=
      

  3.   

    用jion连接两个表,连接条件为数据表.down_class=类型表.class_name
      

  4.   

    同时不要忘了select的where条件还是原来的 “类型表.class_fid = 2”
      

  5.   

    谢谢楼上的各位 尤其是qSELECT * FROM (select * from down_class where class_fid=2) AS t1, down_tbl AS t2 WHERE t2.down_class = t1.class_id;
    这是查询的语句
      

  6.   

    应该还可以用联合查询来做.用inner join 或者join那样会更好一些.