表A
id name myphone_id
1 tome 1
2 jeans 2
3 terry 2
...表B
phone_id phone_name
1 nokia
2 iphone
3 nokia
...统计手机使用比例,查询返回结果如下:
phone_name pencent
nokia 30
iphone 40
htc 25
...但,这个使用比例怎样在查询中统计出来?!
id name myphone_id
1 tome 1
2 jeans 2
3 terry 2
...表B
phone_id phone_name
1 nokia
2 iphone
3 nokia
...统计手机使用比例,查询返回结果如下:
phone_name pencent
nokia 30
iphone 40
htc 25
...但,这个使用比例怎样在查询中统计出来?!
inner join a on a.myphone_id=b.phone_id
group by b.phone_id,b.phone_name