67,515
社区成员
发帖
与我相关
我的任务
分享
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
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'
)
)