如何统计数据库中内容类型基本相同的记录,具体看下面需求:

我把表中的error_context提出来!


1."FATAL EXCEPTION: main
java.lang.SecurityException: Permission Denial: starting Intent
{ cmp=com.funo.activity/.DemoActivity } from ProcessRecord{450046c0 1063:com.funo.activity/10044}
(pid=1063, uid=10044) requires android.permission.ACCESS_CHECKIN_PROPERTIES
 at android.os.Parcel.readException(Parcel.java:1247)
 at android.os.Parcel.readException(Parcel.java:1235)
 at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
 at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
 at android.app.Activity.startActivityForResult(Activity.java:2817)
 at android.app.Activity.startActivity(Activity.java:2923)
 at com.funo.activity.ClientLogRecordActivity$2.onClick(ClientLogRecordActivity.java:45)
 at android.view.View.performClick(View.java:2408)
 at android.view.View$PerformClick.run(View.java:8816)
 at android.os.Handler.handleCallback(Handler.java:587)
 at android.os.Handler.dispatchMessage(Handler.java:92)
 at android.os.Looper.loop(Looper.java:123)
 at android.app.ActivityThread.main(ActivityThread.java:4627)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:521)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 at dalvik.system.NativeStart.main(Native Method)
"

2.。。。

"FATAL EXCEPTION: main
java.lang.SecurityException: Permission Denial: starting Intent
{ cmp=com.funo.activity/.FunoNomalErrorActivity } from ProcessRecord{44fed108 2291:com.funo.activity/10044}
(pid=2291, uid=10044) requires android.permission.ACCESS_CHECKIN_PROPERTIES
 at android.os.Parcel.readException(Parcel.java:1247)
 at android.os.Parcel.readException(Parcel.java:1235)
 at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
 at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
 at android.app.Activity.startActivityForResult(Activity.java:2817)
 at android.app.Activity.startActivity(Activity.java:2923)
 at com.funo.activity.ClientLogRecordActivity$2.onClick(ClientLogRecordActivity.java:45)
 at android.view.View.performClick(View.java:2408)
 at android.view.View$PerformClick.run(View.java:8816)
 at android.os.Handler.handleCallback(Handler.java:587)
 at android.os.Handler.dispatchMessage(Handler.java:92)
 at android.os.Looper.loop(Looper.java:123)
 at android.app.ActivityThread.main(ActivityThread.java:4627)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:521)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 at dalvik.system.NativeStart.main(Native Method)
"
3.。。。。
"FATAL EXCEPTION: main
java.lang.SecurityException: Permission Denial: starting Intent
{ cmp=com.funo.activity/.FunoNomalErrorActivity } from ProcessRecord{450ac280 2400:com.funo.activity/10044}
(pid=2400, uid=10044) requires android.permission.ACCESS_CHECKIN_PROPERTIES
 at android.os.Parcel.readException(Parcel.java:1247)
 at android.os.Parcel.readException(Parcel.java:1235)
 at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
 at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
 at android.app.Activity.startActivityForResult(Activity.java:2817)
 at android.app.Activity.startActivity(Activity.java:2923)
 at com.funo.activity.ClientLogRecordActivity$2.onClick(ClientLogRecordActivity.java:45)
 at android.view.View.performClick(View.java:2408)
 at android.view.View$PerformClick.run(View.java:8816)
 at android.os.Handler.handleCallback(Handler.java:587)
 at android.os.Handler.dispatchMessage(Handler.java:92)
 at android.os.Looper.loop(Looper.java:123)
 at android.app.ActivityThread.main(ActivityThread.java:4627)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:521)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 at dalvik.system.NativeStart.main(Native Method)
"
仔细看上面的三条信息 红色部分标识是不一样的,但是这三条数据在我统计的时候是同一类型的错误,我应该把他们归为一类
我选择分组的方式,但是如果用错误日志的error_context来分组,结果是:
select count(error_context),max(error_date),max(error_time) from error_log group by error_context;
COUNT(ERROR_CONTEXT)   MAX(ERROR_DATE) MAX(ERROR_TIME)
---------------------- --------------- ---------------
1                      2012-03-22      06:55:17       
1                      2012-03-22      06:52:10       
1                      2012-03-22      06:20:03       

3 rows selected
希望 同僚能给点建议!

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页