select ChooseName,Pid from(select [Name] as ChooseName,left(pid,LEN(pid)-1)+'0'as Pid from proinfo)as dt group by ChooseName,Pid
上面那句在SQL里面写的
MYSQL怎么写~?

解决方案 »

  1.   

    我是没听说过MS SQL可以省略说成SQL.
      

  2.   


    select ChooseName,Pid from (select `Name` as ChooseName,CONCAT(LEFT(pid,LENGTH(pid)-1),'0') as Pid from proinfo) as dt group by ChooseName,Pid;
      

  3.   

    select ChooseName,id from (select `name` as ChooseName,CONCAT(LEFT(id,LENGTH(id)-1),'0') as id from my.cq_itemtype) as dt group by ChooseName,id还是不行啊。 他给我返回#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select `name` as ChooseName , CONCAT( LEFT( id , LENGTH( id ) - 哎.