这个问题困扰好久了,一直得不到解决,打个比方,就是像这样一条统计语句:select count(1),aa from t group by aa,但是sybase12.2.1不能使用select count(*) from(select count(1),aa from t group by aa) tt来获取统计结果的记录数,请问要如何才能实现呢???急!!!
------解决方案--------------------------------------------------------
用临时表嘛,
select count(1),aa into newtt from t group by aa
select count(*) from newtt
------解决方案--------------------------------------------------------
不知道是否支持
SELECT COUNT(DISTINCT A1.CID) FROM cms_contentindex A1 INNER JOIN cms_contentindex A2 ON A1.MID=A2.MID