select * from
(
Select ID,Title,Content,'tb1' as tablename from tb1
union all
Select ID,Title,Content,tb2' from tb2
union all
Select ID,Title,Content,'tb3' from tb3
union all
Select ID,Title,Content,'tb4' from tb4
) t
where title like "%myname%"
(
Select ID,Title,Content,'tb1' as tablename from tb1
union all
Select ID,Title,Content,tb2' from tb2
union all
Select ID,Title,Content,'tb3' from tb3
union all
Select ID,Title,Content,'tb4' from tb4
) t
where title like "%myname%"
(
Select ID,Title,Content,'tb1' as tablename from tb1
union all
Select ID,Title,Content,'tb2' from tb2
union all
Select ID,Title,Content,'tb3' from tb3
union all
Select ID,Title,Content,'tb4' from tb4
) t
where title like "%myname%"漏了个',:)
select * from
(
Select ID,Title,Content,'tb1' as tb from tb1
union all
Select ID,Title,Content,'tb2' from tb2
union all
Select ID,Title,Content,'tb3' from tb3
union all
Select ID,Title,Content,'tb4' from tb4
) t
where title like "%myname%"