create table test1(pid int, num int);
insert into test1 values (1,30);
create table test2(sid int, num int,pid int);
insert into test2 values (2,10,1),(3,30,1);
select test1.pid,test1.num,test2.sid,test2.num from test1,test2 where test1.pid=test2.pid;
这样子吗?