日期:2014-05-17  浏览次数:20313 次

网站的整站搜索SQL语句怎样写?
比如我有:products表,news表,about表,case表等等,输入关键字后,怎么写SQL语句?
------最佳解决方案--------------------
select col from products where col like '%关键字%'
union all
select col from news where col like '%关键字%'
union all
select col from about where col like '%关键字%'
union all
select col from case where col like '%关键字%'

------其他解决方案--------------------
你说的是模糊查询或者全文搜索?
------其他解决方案--------------------
你输入什么关键字了?使用SQL要查询什么信息?
------其他解决方案--------------------
能说详细点不?
------其他解决方案--------------------
整站搜索的话还是用全文搜索吧,用阿汤哥那种表多的时候你会死掉的
------其他解决方案--------------------
做个搜索引擎吧~
------其他解决方案--------------------
引用:
做个搜索引擎吧~



哈哈
------其他解决方案--------------------
感谢分享,谢谢!!!