SELECT country,city
FROM customers
GROUP BY country
ORDER BY city DESC

Answer Posted / rod sohrabi

It will only return 1 row per country and will display only the city that is reverse alphabetical order

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I check mysql version?

499


What is mysql server?

492


Why we use mysql workbench?

481


Differentiate CHAR_LENGTH and LENGTH?

592


What data structure does mysql use?

589






How we can see all indexes defined for a table in mysql?

493


How can we optimize stored procedure?

499


How do you kill a long running query in mysql?

474


How can we get total number of records by query in mysql?

501


How do I start and stop mysql server?

489


What is the difference between char and varchar in mysql?

512


What does "i_am_a_dummy flag" do in mysql?

507


why not null is not allowed at table level

2298


What is a definer?

481


What is mysqlcommand?

489