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

How to create a new table by selecting rows from another table in mysql?

495


What is the difference between MyISAM Static and MyISAM Dynamic?

583


Is the syntax correct? Explain the meaning of the syntax given below: $dbc = mysqli_connect('data.aliensabductedme.com', 'owen', 'aliensrool', 'aliendatabase');

528


What is the default port number of mysql?

502


What is mysql connection limit?

513






Does mysql scale well?

497


Which software is used for mysql?

507


What does mysql_query return?

496


How do I change a procedure in mysql?

481


What is the insert?

489


What are the similarities between a function and a procedure?

452


How to drop an existing view in mysql?

528


How to convert dates to character strings?

537


How to change the database engine in mysql?

448


What is a delimiter in mysql?

480