Hi,

I am trying to make a simple search where I can look up orders. The thing that's getting me is I want only one result for each unique 'client_name', and it has to be the most recent row (I have a date column to order by).

So if I have the following (the date is yymmdd):

name | quantity | order_date | details

Tim J | 20 | 130720 | detail1
Tim J | 40 | 130501 | detail2
Tim A | 60 | 120608 | detail3
Tim K | 12 | 130625 | detail4
Tim K | 100 | 111208 | detail5
Tim A | 100 | 111208 | detail6

And I search for Tim, I want it to return 1 row (all columns) for each distinct name but it has to be the most recent row.

So I'd get

Tim J | 20 | 130720 | detail1
Tim A | 60 | 120608 | detail3
Tim K | 12 | 130625 | detail4

I have tried SELECT DISTINCT and GROUP BY (which I don't really understand) but have so far failed..
The searching is under control using WHERE client_name LIKE 'my_search_box'..

I feel this should be so much easier than it seems.. thanks in advance!