求教:在informix中怎么样执行查询语句的同时取得记录的条数?
sql语句如下:
SELECT policyno, BusinessNature, StatusFlag
FROM baofei5400
WHERE 1 = 1
GROUP BY 1,2,3
HAVING
SUM(payamount) <>0.00
如何在执行这个sql语句的同时取得记录的条数???帮帮忙,谢谢!!!
[解决办法]
SELECT policyno, BusinessNature, StatusFlag ,b.CntFROM baofei5400 , ( select count(*) as cnt from ( SELECT policyno, BusinessNature, StatusFlag FROM baofei5400 WHERE 1 = 1 GROUP BY 1,2,3 HAVING SUM(payamount) <>0.00 )) bWHERE 1 = 1 GROUP BY 1,2,3 ,4HAVING SUM(payamount) <>0.00
[解决办法]
select dbinfo('sqlca.sqlerrd2') from systables where tabid=xxx;