全站搜索


select res.id, res.title,res.stype,res.urls,decode(res.stype,1,'新闻',decode(res.stype,2,'帮助',decode(res.stype,3,'解决方案',decode(res.stype,4,'产品',decode(res.stype,5,'咨询'))))) as sstype
from (
select id,1 as stype, SUBSTR(NEWSTITLE,0,25) as title ,'n_view.aspx?newsid='||id as urls
from t_news where is_del=0 and NEWSTITLE like '%1%'
union
select id,3 as stype ,SUBSTR(SOLUTION_TITLE,0,25) as title , 's_view.aspx?viewId='||id as urls
from t_solutions where is_del=0 and SOLUTION_TITLE like '%1%'
union
select id,4 as stype ,SUBSTR(PRODUCT_TITLE,0,25) as title , 'pt_view.aspx?viewId='||id as urls
from t_products where is_del=0 and PRODUCT_TITLE like '%1%'
union
select id,5 as stype,SUBSTR(CONSULT_TITLE,0,25) as title , 'c_view.aspx?consultid='||id as urls
from t_consults where is_del=0 and CONSULT_TITLE like '%1%'
) res

posted @ 2012-02-23 17:56  cn_king  阅读(234)  评论(0编辑  收藏  举报