SqlServer查询语句转换为mysql适用的语句遇到问题

select A.id,A.code,A.name,B.typename, (select top 1 AA.id from Department AA inner join DepartmentType BB on AA.TypeID=BB.TypeID where BB.IsBizAreaType=1 and AA.PWBS like A.WBS + '%') as ChildNodeFlag from T_E_Sys_Department A inner join T_E_Sys_DepartmentType B on A.typeid = B.typeid where A.PWBS = '0' order by A.orderid,A.WBS;

1.(select top 1 AA.id from Department AA inner join DepartmentType BB on AA.TypeID=BB.TypeID where BB.IsBizAreaType=1 and AA.PWBS like A.WBS + '%') 子查询中 like A.WBS + '%' 用法有误如何改??
2. 根据where A.PWBS = '0' 查到的 A.WBS为多条记录,用在第一条的子查询出错,怎么解决??
感谢解答

select * from table1 order by id desc limit 1

第一个你试试加个括号?like (A.WBS + '%')
蹲个答案 我也很好奇