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.
Eva Ferguson — — source: Informix-list mailing list archive (1991-1998)
The following select will work if you don't mind getting the max(value)
returned as well as hour.
select max(value),hour from table_name group by name,date
Hope this helps,
Eva Ferguson
}----------
}From: Rob Allen[SMTP:slcc@cnwl.igs.net]
}Sent: Wednesday, November 13, 1996 3:12 PM
}To: informix-list@rmy.emory.edu
}Subject: SQL Query help needed
}
}I am trying to figure out the query to select this type of information.
}
}-------------------------------
}| name | date | hour | value |
}-------------------------------
}| a|961010| 0100| 32|
}| b|961012| 1600| 3423|
}| a|961010| 0200| 345|
}| a|961011| 0300| 0|
}| a|961010| 1700| 999|
}
}and so on.
}
}What I am looking for is the hour that is related to the max(value) for
}grouped by the name and date.
}
}In the above I would hope to get
}1600 for b-961012-1600-3423
}1700 for a-961010-1700-999
}0300 for a-961011-0300-0
}
}I thank you in advance for help you can provide.
}
}Please reply to slcc@cnwl.igs.net
}
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.