select distinct tagname, count(tagname) as tagcount from tag where (adduserid = 65) and (tagcount > 1) group by tagname order by tagcount desc
执行后报错:列名 'tagcount ' 无效。
怎么解决?
发表于:2007-05-30 21:33:351楼 得分:3
select tagname,tagcount from ( select distinct tagname, count(tagname) as tagcount,adduserid from tag group by tagname,adduserid order by tagcount desc )a where (adduserid = 65) and (tagcount > 1)
发表于:2007-05-30 21:33:432楼 得分:15
select distinct tagname, count(tagname) as tagcount from tag where (adduserid = 65) group by tagname having count(tagname) > 1 order by tagcount desc
发表于:2007-05-30 21:33:473楼 得分:2
select * from ( select distinct tagname, count(tagname) as tagcount from tag where (adduserid = 65) and (tagcount > 1) group by tagname ) t order by tagcount desc