如何从MySQL group_by数据集中排除特定重复项?

时间:2018-10-24 20:29:18

标签: mysql

我正在使用MySQL 5.7.12。我有一个简单的查询,如下所示:

  2018-10-24 23:09:57.577 10744-10744/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.guahoo.tarotoftheday17, PID: 10744
java.lang.OutOfMemoryError: Failed to allocate a 196247420 byte allocation with 4194304 free bytes and 130MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:620)
    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:455)
    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1155)
    at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:720)
   .....and further

我想从分组中排除所有重复的USER_ID记录。所以我做了以下事情,但是,它没有返回任何结果:

SELECT COUNT(id) as count, pic_id
FROM user_pictures 
GROUP BY pic_id 

我在这里想念什么?

1 个答案:

答案 0 :(得分:1)

使用"files": [ { "pattern": "my_repo/ver/${branchVersion}/${releaseVersion}/*.exe", "target": "${WORKSPACE}/installer/" } ,因此不会计算相同DISTINCT的重复项:

user_id