bitsCN.com
要求:
有两个表ttest1、ttest2,结构如下,求 localname ,用户数
ttest1:地区码、用户id
ttest2 :地区名、地区码
sql:
SELECT localname , COUNT( DISTINCT uid )FROM ttest1,ttest2WHERE ttest1.localid = ttest2.localidGROUP BY localname
结果:
缺陷:对于地区d,没有显示用户为0
大家有什么好的方法,欢迎回复 bitsCN.com
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn