This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4643|Reply: 3

[Source] SQL Server groups a row of data with the largest (small) value

[Copy link]
Posted on 12/1/2022 8:54:47 PM | | | |
Requirements: The same Name has data in different years, and the SQL Server database obtains the largest row of data for the year according to the Name, that is, only one data is taken for each Name.

As shown below:



First, create a new test table and insert the data, the script is as follows:

Get the row of data with the largest year based on Name, and the code is as follows:

(End)





Previous:The Add-Migration item cannot be recognized as a cmdlet, function, script file
Next:Owned the first computer host assembled by himself
Posted on 12/1/2022 9:53:03 PM |
Learn to learn...
Posted on 12/2/2022 8:49:57 AM |
Come to learn art, Brother Z is really easy to learn.
Posted on 12/5/2022 10:31:15 AM |
Learn it
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com