Sql语句学习 一. select playerId, count(playerId) as num from OperateLog_$i where playerId > 0 and rootId = 12 and typeId = 12156 and actionTime >= 1381509000000 and actionTime <= 1381511220000 group by playerId having count(*) > 2; this-- > 可以计…
在学习动态SQL语句之前,首先必须对条件查询有一定了解,先来学习如何向IBatis.Net的映射文件里传入参数吧. 一.条件查询 1.传递单个参数 如根据Id查询: <select id="SelectOnePerson" resultMap="PersonModel"> <!--其中#Id就是传入的参数--> select * from person where Id = #Id# </select> 调用的时候,只需要传入对应…
数据库各个表空间增长情况的检查: SQL >SELECT A.TABLESPACE_NAME,( 1-(A.TOTAL)/B.TOTAL)* 100 USED_PERCENT FROM (SELECT TABLESPACE_NAME,SUM (BYTES) TOTAL FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) A,(SELECT TABLESPACE_NAME,SUM (BYTES) TOTAL FROM DBA_DATA_FILES GROUP…