select case when (SELECT count(*) FROM cdb_posts where authorid=c.uid)>=10 then 10 when (SELECT count(*) FROM cdb_posts where authorid=c.uid)<5 then -10 else -5 end as post from cdb_members c wheregroupid='3'这个语句(SELECT count(*) FROM cdb_posts where authorid=c.uid)能简写不????
when aa<5 then -10 else -5 end
from (
SELECT count(*) as aa FROM cdb_posts a
inner join cdb_members c
on a.authorid=c.uid
where c.groupid='3') a
select if(aa>=10,10,if(aa<5,-10,-5))
from (
SELECT count(*) as aa FROM cdb_posts a
inner join cdb_members c
on a.authorid=c.uid
where c.groupid='3') a1
from cdb_members c inner join cdb_posts p on c.uid=p.authorid
where c.groupid='3'