ArtNo Week
| A1 | 2 | ||
| A2 | 2 | ||
| A3 | 2 | ||
| A4 | 1 | ||
| A4 | 4 | ||
| A3 | 6 | ||
| A5 | 6 | ||
Result should be
| A1 | 2 | ||
| A2 | 2 | ||
| A3 | 6 | ||
| A4 | 4 | ||
| A5 | 6 |
In the result rowsets I need distinct ArtNo with there Max WEEk.
NEED HELP...
| A1 | 2 | ||
| A2 | 2 | ||
| A3 | 2 | ||
| A4 | 1 | ||
| A4 | 4 | ||
| A3 | 6 | ||
| A5 | 6 | ||
| A1 | 2 | ||
| A2 | 2 | ||
| A3 | 6 | ||
| A4 | 4 | ||
| A5 | 6 |
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanjeeb LenkaPosted Oct 16, 2013, 7:02 AM
Ravi ShekharPosted Oct 16, 2013, 6:45 AM
Kiran Kumar TalikotiPosted Oct 16, 2013, 6:23 AM
from Table_Name
group by artno
Sanjeeb LenkaPosted Oct 16, 2013, 6:20 AM
SELECT ARTNO,MAX(WEEK) AS WEEK FROM TABLENAME GROUP BY ARTNO