Gossamer Forum
Home : General : Databases and SQL :

Confused about MIN() and MAX()...

Quote Reply
Confused about MIN() and MAX()...
Ok...this has me a little confused. The MySQL Manual (on group by) has the following to say;

Quote:
mysql> SELECT student_name, MIN(test_score), MAX(test_score)
-> FROM student
-> GROUP BY student_name;

Is this saying that both MIN() and MAX() have to be defined?

All I want/need to do is get the MAX() number held in the 'Weight' field Unsure It would really help now, and in future stuff if I could understand how this worked...as it looks like it could be as useful as the WHERE clause Smile

Cheers in advance.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Confused about MIN() and MAX()... Andy 7561 Jan 22, 2003, 2:29 AM
Thread Re: [Andy] Confused about MIN() and MAX()...
Paul 7198 Jan 22, 2003, 2:35 AM
Thread Re: [Paul] Confused about MIN() and MAX()...
Andy 7213 Jan 22, 2003, 2:48 AM
Thread Re: [Andy] Confused about MIN() and MAX()...
Paul 7170 Jan 22, 2003, 2:53 AM
Post Re: [Paul] Confused about MIN() and MAX()...
Andy 7247 Jan 22, 2003, 2:58 AM