INSERT INTO ordersNew(goodName,goodNum,receiveAddress)
SELECT (SUBSTRING_INDEX(
SUBSTRING_INDEX(
SUBSTRING_INDEX(
goodsName,')',1),'(',-1),'+', 1)),
(goodsNum<![CDATA[*]]>SUBSTRING_INDEX(fenNum,'+',1)),receiveAddress
FROM orders WHERE goodsName LIKE CONCAT ('%','#','%') AND goodsName
IN (SELECT o.goodsName FROM orders AS o WHERE (LENGTH(o.goodsName) -
SELECT (SUBSTRING_INDEX(
SUBSTRING_INDEX(
SUBSTRING_INDEX(
goodsName,')',1),'(',-1),'+', 1)),
(goodsNum<![CDATA[*]]>SUBSTRING_INDEX(fenNum,'+',1)),receiveAddress
FROM orders WHERE goodsName LIKE CONCAT ('%','#','%') AND goodsName
IN (SELECT o.goodsName FROM orders AS o WHERE (LENGTH(o.goodsName) -
LENGTH(REPLACE (o.goodsName, '+', '')))=1 AND goodsName LIKE CONCAT ('%','#','%'));
在XxMapper.xml中嵌入sql语句时*嘚用<![CDATA[*]]>进行处理