56,940
社区成员




Create table tab_00A(hid int,typeid int);
insert into tab_00A
select 1001,7 union all
select 1002,5
Create table tab_00B(id int,hid int,name varchar(22));
Insert tab_00B
select 1,1001,N'工业' union all
select 2,1001,N'农业' union all
select 4,1001,N'渔业' union all
select 1,1002,N'工业' union all
select 4,1002,N'渔业'
select hid,GROUP_CONCAT(id) as id,GROUP_CONCAT(name) as name
from
(
SELECT a.hid,
b.id,
b.name
FROM tab_00A a
INNER JOIN tab_00B b ON a.hid = b.hid
) a
group by hid