多表查询分页

来源:互联网 发布:笔记本哪个防护软件好 编辑:程序博客网 时间:2024/05/20 01:07

sql="select news_id,news_title,news_date,'news' as t from news_info where news_title like '%计算机%' union select cous_id as news_id,cous_cname as news_title,cous_date as news_date, 'cous' as t from cous_info where cous_cname like '%计算机%'"

以上语句实现查询结果相连,其他同分页!

原创粉丝点击