Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Christopher Etz — — source: Informix-list mailing list archive (1991-1998)
In article <328A39AF.5C19@cnwl.igs.net>,
Rob Allen <slcc@cnwl.igs.net> wrote:
>
>-------------------------------
>| name | date | hour | value |
>-------------------------------
>| a|961010| 0100| 32|
>| b|961012| 1600| 3423|
>| a|961010| 0200| 345|
>| a|961011| 0300| 0|
>| a|961010| 1700| 999|
>
>What I am looking for is the hour that is related to the max(value) for
>grouped by the name and date.
SELECT * FROM table outer
WHERE value = (SELECT MAX(value) FROM table inner
WHERE outer.name = inner.name
AND outer.date = inner.date)
If you really want only the hour is question, you can replace "*" by
"hour". But how would know the name and date related to this hour?
Hope, I understood (and answered) your question right,
Christopher
--
________________________________________________________________________
Christopher Etz Telefon: (069) 318091 od. 30851063
Kopernikusstr. 28 Telefax: (069) 30851163
D-65929 Frankfurt/Main Email: cetz@cetz.rhein-main.de
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.