select concat(superId,name) as newfield from 部门表 where id='部门Id';

解决方案 »

  1.   

    如果中间需要+号:select concat(superId,'+',name) as newfield from 部门表 where id='部门Id';
      

  2.   

    select (select name from 部门表 y WHERE y.id=x.superId),name from 部门表 x where id=??
      

  3.   

    刚才没看清题意,sorry!改正如下:SELECT
    CONCAT(IFNULL((SELECT name FROM depinfo a WHERE a.id=b.superid),'一级部门'),'+',
    name)  as supername FROM depinfo b WHERE b.id='search_id';depinfo:部门表
    search_id:要查询的id变量
      

  4.   

    select b.name from 部门表 a,部门表 b where a.superId=b.id and a.id='部门Id';
      

  5.   

    select concat(b.name,'+',a.name) from 部门表 a,部门表 b where a.superId=b.id and a.id='部门Id';