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

What does mysqli stand for?

661


How many entries can mysql handle?

699


What is mysql and how it works?

614


How can you retrieve a particular number of records from a table?

666


Consider a scenario where you have two to three tables with thousand tuples in each of them. Now, if you have to perform a join operation between them will you choose to perform filtering of rows or transforming of rows first.

724






How to delete an existing column in a table?

654


What is the hostname for mysql database?

675


Can u give the example by taking an unnormalized table and make that 1nf and then 25nf, and then 3 nf?

4386


Why to use char instead of varchar in the database?

760


What is ibdata1?

658


What do you need to connect php to mysql?

684


How many types of indexes are there in mysql?

649


How do I start mysql from command line?

692


How to use sum function in where clause in mysql?

667


What is difference between statement and preparedstatement?

676