子查询返回的可能是多条记录。
1)
select q.id from q where q.fzr like '%"+fullname+"%'
2)
select q.id from Pro as q where q.pid=(select q.id from q where q.fzr like '%"+fullname+"%')
你先执行1)再执行2),看看哪个返回的是多条记录。
你可以改成
select * from Work as p where p.pid in (select q.id from Pro as q where q.pid in (select q.id from q where q.fzr like '%"+fullname+"%'))
ORA-01427:单行子查询返回多个行
因此,你要再加过滤条件或者做做其他处理,直到子查询的返回结果为单条记录为止。还不明白可以再问我。希望对你有所帮助。