I know that the name doesnโt sound very descriptive, but this is the best I could come up with:
I have this table
ID BDATE VALUE
28911 04/14/2009 44820
28911 04/17/2009 32,240
28911 04/20/2009 30550
28911 04/22/2009 4422587.5
28911 04/23/2009 4441659
28911 24/4/2009 7749594.67
38537 04/17/2009 58280
38537 04/20/2009 137240
38537 4/22/2009 81098692
38605 14/4/2009 2722368
38605 04/20/2009 5600
38605 04/22/2009 1625400
38605 04/23/2009 6936575
which is actually a very complex query, encapsulated in the form, but now it is not.
I would like to have for each id a string containing the highest BDate. In this example, this will be the result.
ID BDATE VALUE
28911 24/4/2009 7749594.67
38537 4/22/2009 81098692
38605 04/23/2009 6936575
I have already tried
select id, max(bdate), value from myview group by id, value
but then it returns all rows, because for each value the column value is different. This query was developed in Oracle v10, and I have the right to use only individual queries, and not create procedures.
sql oracle greatest-n-per-group
kurast
source share