Ken Kixmoeller f/h wrote:
> SELECT pk_val,part,ClassWhen
> from my_sched
> where ClassWhen >= 2009-12-01 00:00:00
> group by part
> order by part,ClassWhen
SELECT part as part,
MAX(ClassWhen) as ClassWhen
FROM my_sched
WHERE ClassWhen >= 2009-12-01 00:00:00
GROUP BY part
Then if you absolutely need the associated PK[1], you can do another select:
SELECT pk_val
FROM my_sched
WHERE ClassWhen = <ClassWhen>
AND part = <part>
Note that that second select could result in multiple records if there are
multiple
part/ClassWhen combinations.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.