摘要:
一、首先说一下我的需求,在数据表T_CERTI_EXELAW中求certicode字段前三位出现次数最多的三位(期望结果是207),数据表如下: 期望结果是207二、两种sql语句比较(oracle数据库)方法一:常规嵌套(耗时:0.031seconds)SELECT NAME FROM (SELECT HEAD AS NAME, COUNT(HEAD) AS TIMES FROM (SELECT SUBSTR(M.CERTICODE, 0, 3) AS HEAD FROM T_CERTI_EXELAW M WHERE M.MAKEDEPART = ... 阅读全文