How to get only one record for each duplicate rows of the id in oracle?

Posted by Psychocryo on Stack Overflow See other posts from Stack Overflow or by Psychocryo
Published on 2013-11-12T03:17:58Z Indexed on 2013/11/12 3:54 UTC
Read the original article Hit count: 120

Filed under:
|
|
|
|

suppose i have this table:

group_id | image | image_id |
-----------------------------
23        blob       1
23        blob       2
23        blob       3
21        blob       4
21        blob       5
25        blob       6
25        blob       7

how to get results of only 1 of each group id? in this case,there may be multiple images for one group id, i just want one result of each group_id

i tried distinct but i will only get group_id. max for image also would not work.

© Stack Overflow or respective owner

Related posts about sql

Related posts about database