SQL Fetch duplicate record field value one record

Source: Internet
Author: User
Keywords Network programming Database synthesis
Tags file function get group name network network programming not included

SQL takes ABC field a record with the largest field value of a

Select Max (a), b,c from table name GROUP by b,c

The file is simple.

About Max

Max () function
The Max function returns the maximum value in a column. Null values are not included in the calculation.

SQL Max () syntax
Select Max (column_name) from table_name Note: Min and Max can also be used in text columns to get the highest or lowest value in alphabetical order.

Aggregate functions, such as sum, often need to add a group by statement.
GROUP BY statement
The GROUP BY statement is used to combine aggregate functions to group result sets based on one or more columns.

SQL GROUP BY syntax
Select column_name, aggregate_function (column_name)
From table_name
WHERE column_name operator value
GROUP BY column_name

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.