MySQL Forums
Forum List  »  MySQL Workbench

Highest value in column A for each value in column B
Posted by: Lorena Gosálvez Casanova
Date: February 07, 2018 06:21AM

I have one table with two columns: CUSTOMERS and HOURS (both are TINYTEXT)

I need a SELECT that returns the highest hour for each customer.

Ex:

CUSTOMERS: (c1, c1, c1, c2, c2, c3, c3)
HOURS: (09:00, 10:00, 11:00, 10:30, 11:00, 11:00, 11:30)

RESULT:

CUSTOMERS: (c1, c2, c3)
HOURS: (11:00, 11:00, 11:30)

Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
Highest value in column A for each value in column B
709
February 07, 2018 06:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.