Hi. Try this one:

SELECT MAX(score) FROM scores_1, scores_2
WHERE Id = 15


Greetz
- Daniel Backhausen

-----Ursprungliche Nachricht-----
Von: Anatole [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 10. Dezember 2001 11:32
An: [EMAIL PROTECTED]
Betreff: SELECT QUERY Problem


Hello,

I often run into the problem of trying to join several tables and select
just the most recent (or largest) item from a series of entries.

For example.....

Table 1: names
Id | name
15 | George
16 | Suzy

Table 2 : scores_1
Id | score
15 | 85
15 | 60
15 | 70
15 | 95

Table 3 : scores_2
Id | score
15 | 50
15 | 55
15 | 60
15 | 45

What I want to end up with is a selection that would pick up George and his
highest score on score_1 and score_2 (i.e. George 95 60)

Anybody have a pretty way to do this???

Thanks for any advice you can throw my way!

anatole


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to