select count(*) from db1 where grade = 1;
select count(*) from db1 where grade = 2;
select count(*) from db1 where grade = 3;
如何将这3条sql语句合成一条?
在mysql中:
SELECT (SELECT COUNT(*) FROM db1 WHERE gread = 1) AS g1,(SELECT COUNT(*) FROM db1WHERE gread = 2) AS g2;
DB2呢?怎么实现?