select 'table1' as 表名, * from table1 where id=4
union all
select 'table2' as 表名, * from table2 where id=4
union all
select 'table3' as 表名, * from table3 where id=4
union all
select 'table2' as 表名, * from table2 where id=4
union all
select 'table3' as 表名, * from table3 where id=4
where ID = 4
union
select 'table2' as tablename,ID,Name,Detail from table2
where ID = 4
union
select 'table3' as tablename,ID,Name,Detail from table3
where ID = 4