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 purpose of -> in the mysql terminal?

653


What is flush privileges in mysql?

533


How do I edit a database in mysql workbench?

492


What is a storage engine?

571


What is the difference between a heap table and temporary table?

513






What is root password?

483


What are the reasons for selecting lamp (linux, apache, mysql, php) instead of combination of other software programs, servers and operating systems?

588


Difference between CHAR and VARCHAR?

599


What is mysql gpl?

487


How do I kill a mysql query?

462


What does mysqli_fetch_assoc do?

507


What is cursor in mysql?

501


What is the phantom problem?

508


What is an index? How can an index be declared in mysql?

497


Is pdo more secure than mysqli?

470