a表
id order
1 cpio textxx
2 mkdir dfab表
command color
cp 蓝
cpio 红
要求查询出a表中包含有b表中command的order数据。
我之前是这样写的select * from a where locate(b.command,a.order)=1本来数据都是正常的,结果当b表中出现cp和cpio这样都包含cp的情况时,查询结果就是:
id order
1 cpio textxx
2 cpio textxx
一条数据匹配了两次,数据出现重复,请问有谁能帮忙解决一下
id order
1 cpio textxx
2 mkdir dfab表
command color
cp 蓝
cpio 红
要求查询出a表中包含有b表中command的order数据。
我之前是这样写的select * from a where locate(b.command,a.order)=1本来数据都是正常的,结果当b表中出现cp和cpio这样都包含cp的情况时,查询结果就是:
id order
1 cpio textxx
2 cpio textxx
一条数据匹配了两次,数据出现重复,请问有谁能帮忙解决一下
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货