新微赢技术网

标题: 多表搜索查询的问题 [打印本页]

作者: 第三滴眼泪$    时间: 2010-1-17 08:22
标题: 多表搜索查询的问题
sql="select * from zxtbbd union select * from consume union select * from lsploy union select * from lspostulant union select * from lsschool where Title like '%"&trim(keyword)&"%' or author like '%"&trim(keyword)&"%' or times like '%"&trim(keyword)&"%' or content like '%"&trim(keyword)&"%' or fclass like '%"&trim(keyword)&"%"
上面这段代码有表zxtbbd,consume,lsploy,lspostulant ,lsschool 五个表,这五个表结构相同.
我还想在加2个表,但这2个表与上面5个表结构不同,所以不能用union,要查询的字段一样地都是
title,author等,只是要加地2个表还有其它字段,请问如何实现




欢迎光临 新微赢技术网 (http://bbs.weiying.cn/) Powered by Discuz! X3.2