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
Where is the mysql config file?
What is the query to display top 20 rows?
Is blocked because of many connection errors mysql?
What is ibdata1?
Hi Team, This is kartik, I recently completed my B-tech. Importance of posting this question is for to know the best books on SQL(MYSQL/Oracle)? I like SQL concept's so much, at the same time i decided to choose SQL for my career purpose. So please suggest me the best books that are very helpful for a fresher to improve concepts like (SQL/PLSQL)Basics, programming concepts, architectures etc. Please consider my request as an important one. I am very thankful to you for providing this opportunity. If possible can you please send the names of books for my personal id also: karthikgdv1206@yahoo.com. Thanks, Kartik T
What is table level locking in mysql?
what is the difference between the nvl function, ifnull function, and the isnull function? : Mysql dba
Is mysql a scripting language?
how to get only updated, deleted , inserted records after certain interval time in mysql with out using triggers...
What is max_used_connections in mysql?
What could be the reason that the mysql statement 'select avg (salary) from emp' generates an inaccurate output?
What is the default port for MySQL Server?
Explain csv tables.
What is the return type of mysqli_query?
What's the difference between mysql and sql server?