[Quote=引用 4 楼 chengyou1985 的回复:]
引用 3 楼 gelyon 的回复:
select name1,total1,name2,total2 from
(
select name1,count(name1) total1 from test group by name1
)
,
(select name2,count(name2) total2 from test group by name2
);
这样写能统……
[/Quote]
select name1,total1,name2,total2 from
(
select name1,count( distinct name1) total1 from test group by name1
)
,
(select name2,count( distinct name2) total2 from test group by name2
);
[Quote=引用 3 楼 gelyon 的回复:]
select name1,total1,name2,total2 from
(
select name1,count(name1) total1 from test group by name1
)
,
(select name2,count(name2) total2 from test group by name2
);
[/Quote]
select name1,total1,name2,total2 from
(
select name1,count(name1) total1 from test group by name1
)
,
(select name2,count(name2) total2 from test group by name2
);