select * from table_a where actid = 17
union all
select * from table_b where actid = 17
您可能(或可能不需要)对ID不唯一的内容进行处理,例如
select 'Student', table_a.* from table_a where actid = 17
union all
select 'Faculty', table_b.* from table_b where actid = 17
MYSQL-连接两个表
select * from table_a where actid = 17
union all
select * from table_b where actid = 17
您可能(或可能不需要)对ID不唯一的内容进行处理,例如
select 'Student', table_a.* from table_a where actid = 17
union all
select 'Faculty', table_b.* from table_b where actid = 17