日期:2014-05-16  浏览次数:20810 次

帮忙修改SQL
select m.apply_person,m.dts_no,m.version_no, g.duty_person,g.group_id,s.station_name from param_monad as m join (select group_id,station_id,duty_person from param_group) g on g.group_id = m.group_id join param_station as s on g.station_id = s.station_id  
where m.id = 75 and
s.station_name like '%'m.station_name'%'

主要的问题是

s.station_name like '%'m.station_name'%'这里怎么写?m.station_name 前面查询的表字段


谢谢

------解决方案--------------------
s.station_name like '%m.station_name%' 

------解决方案--------------------
where instr(s.station_name,m.station_name)>1
------解决方案--------------------
like的语法是----》like '%字符串%'
------解决方案--------------------
s.station_name like concat('%',m.station_name,'%')
------解决方案--------------------
s.station_name like concat('%',m.station_name,'%')
or
instr(s.station_name,m.station_name)>1
无法用到索引