Analysis on the compatibility of a MYSQL syntax (using count in queries)

Source: Internet
Author: User
This article provides a detailed analysis of the compatibility of MYSQL syntax (using count in queries, for a friend who needs to copy the code using count and more fields in a query, the Code is as follows: selectcount (id), id, and namefromtable, my environment is 5.5, and the result can be obtained,

This article provides a detailed analysis of the compatibility of MYSQL syntax (using count in queries, for more information, see the following code for using count and more fields in the query: select count (id), id, name from table, my environment is 5.5, and the result can be obtained,

This article provides a detailed analysis of the compatibility of MYSQL syntax (using count in queries). For more information, see

Simply put, you can use count and more fields in the query.

The Code is as follows:


Select count (id), id, name from table


It's embarrassing. My environment is 5.5, and the results can be obtained, but it won't work if I run it on the server.
Okay, an error is reported.

The Code is as follows:


#1140-Mixing of GROUP columns (MIN (), MAX (), COUNT (),...) with no GROUP columns is illegal if there is no group by clause


In step 5. x can be used, but the values of other fields only obtain the first piece of information. Well, I admit that this is a partial method and has no practical significance, it may be caused by a new beginner's unclear syntax structure.
Well, as a newbie, I am still wise to use the WAMP version switch function to switch over.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.