phpcms系统,在多个表格中搜索多个字段的sql语句?
select title from phpcms_content
union all
select name from phpcms_c_news where name like %123%
结果是把title和name 放一张表中
union all
select name from phpcms_c_news where name like %123%
结果是把title和name 放一张表中
用表的关联来实现,你可以参考下
select title from phpcms_content where title like %123% union all
select name from phpcms_c_news where name like %123%
select title from phpcms_content where title like %123% union all
select name from phpcms_c_news where name like %123%
select * from (
select title t_name from phpcms_content
union all
select name t_name from phpcms_c_news
)
where t_name like %123%
select title t_name from phpcms_content
union all
select name t_name from phpcms_c_news
)
where t_name like %123%