日期:2014-05-20 浏览次数:20751 次
select * from pages where id in ( -- get all records select distinct id from pages where id in ( --remove duplicate records select id from pages where url like '%google%' --url contains 'google' union all select id from pages where content like '%google%' --content contains 'google' union all select id from pages where body like '%google%' --body contains 'google' ) )
------解决方案--------------------
select url,body,content decode(instr(url, 'google'), 0, decode(instr(body, 'google'), 0, decode(instr(content, 'google'), 0, 4, 3), 2), 1) type_order from pages order by type_order