Select Max question

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Jan 25 10:29:31 CST 2004


on 1/25/04 8:32 AM, Keith DeLong at delong at redcort.com wrote:

> My lack of SQL knowledge is frustrating me tonight...again. I cannot figure
> out how to get the latest entry for each person in a table.
> 
> I started with:
> 
> SELECT Max(Date_Entered)
> FROM Matters
> 
> As expected, this returns the last entry made in the date.
> However, I want the last entry for each person. So I next tried to get the
> max for a given person:

If you need FOR EACH, you need GROUP BY


> SELECT Max(Date_Entered)
> FROM Matters
> Where Person_ID = 4
> 
> I got the same result as above. After some experimentation it seems
> Valentina is ignoring the WHERE clause all together when Max is used. This
> seems also true for Distinct.  Is this the normal way for SQL to work or a
> Valentina oddity?
> 
> Is there is a query solution that I am missing at this late hour of a long
> week?

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list