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

Answer Posted / manoj pandey

This is wrong because there is no aggregate function in the
query when a group by clause is used.

The above query could be like:

1. SELECT country, count(city)
2. FROM customers
3. GROUP BY country
4. ORDER BY country DESC

* Correction at line 1 & 4.

Is This Answer Correct ?    12 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the default port for mysql and how it can change?

754


How many columns can be used for creating Index?

753


How many tables we can create in mysql database?

683


How much does mysql enterprise cost?

683


change column name and make a unique column so we get no dupes.

718


Where is mysql password stored?

662


How to filter data from a mysql database table with php?

648


Is mysql owned by oracle?

722


What is sql in mysql?

747


How can you change the name of any existing table by using the sql statement?

739


What is the command used to create a database using php and mysql?

848


What are the difference between mongodb and mysql?

935


How to define numeric 9(3) in db2 table without decimal point??

2611


can you tell what are the different set operations available in mysql? : Mysql dba

689


How does mysql store binary data?

684