SQL语句有错误的吧
你是否使用了形如
select 
(select b from table2   --这儿只能够返回一条记录,返回多条记录会报错。
where ...)
from table1你可以改为:select max(b) from table2