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怎么写~?
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;
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 ) - 哎.
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;