E
Enrique Rojas
Hello,
I am trying to make a query in which I just want to show the records
with the maximum values. It sounds so simple but my sql is a really
rusty when it comes to aggregates.
table a
D_ID D_NAME LEVEL_ID YEAR1 YEAR2 YEAR3
5 TM114 2 2 2 2
5 TM114 1 1 1 1
5 TM114 0 0 1 3
24 TC201P 1 4 5 6
24 TC201P 2 5 9 9
24 TC201P 0 1 4 3
I just want the maximum Level_ID rows.
D_ID D_NAME LEVEL_ID YEAR1 YEAR2 YEAR3
5 TM114 2 2 2 2
24 TC201P 2 5 9 9
I tried selecting with max(level_id) with d_name in the grouping and
it is fine. But when I grouped by year1 the other levels show.
Thanks in advance sorry for the simple question.
Enrique Rojas
I am trying to make a query in which I just want to show the records
with the maximum values. It sounds so simple but my sql is a really
rusty when it comes to aggregates.
table a
D_ID D_NAME LEVEL_ID YEAR1 YEAR2 YEAR3
5 TM114 2 2 2 2
5 TM114 1 1 1 1
5 TM114 0 0 1 3
24 TC201P 1 4 5 6
24 TC201P 2 5 9 9
24 TC201P 0 1 4 3
I just want the maximum Level_ID rows.
D_ID D_NAME LEVEL_ID YEAR1 YEAR2 YEAR3
5 TM114 2 2 2 2
24 TC201P 2 5 9 9
I tried selecting with max(level_id) with d_name in the grouping and
it is fine. But when I grouped by year1 the other levels show.
Thanks in advance sorry for the simple question.
Enrique Rojas