select distinct a.fundcode,a.fundnameabbr,a.pinyincode from tb_fundarchive a ,tb_fundnetvalue b where
a.isdeleted = 0 and a.fundtype = 7 and a.fundcode = b.fundcode
and (a.fundcode like '%021%' or a.pinyincode like '%021%' or a.fundname like '%021%' or a.fundnameabbr like '%021%')
a.isdeleted = 0 and a.fundtype = 7 and a.fundcode = b.fundcode
and (a.fundcode like '%021%' or a.pinyincode like '%021%' or a.fundname like '%021%' or a.fundnameabbr like '%021%')
from tb_fundarchive a ,tb_fundnetvalue b
where a.isdeleted = 0 and a.fundtype = 7
and a.fundcode = b.fundcode---注意内连接要有符合的条件,否则就查不到数据。
and (a.fundcode like '%021%' or a.pinyincode like '%021%'
or a.fundname like '%021%' or a.fundnameabbr like '%021%')
前两天我就遇到了这个问题,
还望能指教一下!在此谢了!
加上distinct应该是可以的,mysql确实没用过。不太了解。
select distinct a.fundcode,a.fundnameabbr,a.pinyincode
from tb_fundarchive a ,tb_fundnetvalue b
where a.isdeleted = 0 and a.fundtype = 7 and a.fundcode = b.fundcode
and (a.fundcode like '%021%' or a.pinyincode like '%021%' or a.fundname like '%021%' or a.fundnameabbr like '%021%')