DECLARE @Names TABLE (
name VARCHAR(20)
); INSERT INTO @Names VALUES
('DeSzmetch'),('DESZMETCH'),('DESZMETCK'),('DesZmetch'),('deszmetch'); SELECT
name,
RANK() OVER (ORDER BY name COLLATE Latin1_General_BIN) AS [Lat...BIN],
RANK() OVER (ORDER BY name COLLATE Traditional_Spanish_CI_AS) AS [Tra...CI_AS],
RANK() OVER (ORDER BY name COLLATE Latin1_General_CS_AS) AS [Lat...CS_AS],
RANK() OVER (ORDER BY name COLLATE Latin1_General_CI_AS) AS [Lat...CI_AS],
RANK() OVER (ORDER BY name COLLATE Hungarian_CI_AS) AS [Hun..._CI_AS]
FROM @Names
ORDER BY name COLLATE Latin1_General_BIN;
GO

  ---order Don't worry, the following fields can also be different , But it's in the last order

DECLARE @Student table   -- Student transcript 
(
id int, -- Primary key
Grade int, -- class
Score INT, -- fraction
name VARCHAR(120) -- name
)
INSERT INTO @Student VALUES
(1,1,88,'A1'),(2,1,66,'B1'),(3,1,75,'C1'),(4,2,30,'D1'),(5,2,70,'E1'),
( 6,2,80,'F1'),(7,2,60,'G1'),(8,3,90,'H1'),(9,3,70,'I1'),(10,3,80,'j1') --SELECT * FROM @Student SELECT name,Score,
rank() OVER(ORDER BY Grade DESC) AS rankGrade,
rank() OVER(ORDER BY Score DESC) AS rankScore,
rank() OVER(ORDER BY id DESC) AS rankid
FROM @Student

  

SQL Technology insider -6 rank()over(order by XX COLLATE) More related articles on the usage of

  1. SQL Inside technology 3

    Select Analyze a query instance Select empid,year(orderdate) as orderYear,count(*) as orderCount From dbo.orderInfo ...

  2. SQL Technology insider 4

    data type : sql server Only two data types are accepted 1. Ordinary character varchar char One character in a byte , Expressing English 2.unicode   nchar nvarchar Use two bytes to represent a ...

  3. SQL Inside technology 2 DDL

    Create database : if db_id('DBTest') is nullcreate database DBTest Create table use eb_fy_data_test---use Switch the database context if ...

  4. SQL Technology insider one

    normal form : Normalization rules for relational models . Codd Three database paradigms are proposed : 1. First normal form The first paradigm requires that every row in a table must be unique . Because relational databases are based on set theory , And in the definition of set , Every element is required to be unique ( In relation ...

  5. 【 Journal entry 1】SQL2008 Technology insider - SQL Logical query processing

    Introduction point of view 1. Programming languages change with each passing day , But no one has ever denied sql Great role in modern programming and Continuous availability .SQL Provide data query ability with human friendly reading experience ( Compared with other programming languages ), At the same time in a variety of database platforms , Basics ...

  6. 《[MySQL Technology insider :SQL Programming 》 Reading notes

    <[MySQL Technology insider :SQL Programming > Reading notes 2019 year 3 month 31 Japan 23:12:11 It is strictly prohibited to reprint !!! <MySQL Technology insider :SQL Programming > This book is one of my favorite domestic authors, Jiang Chengyao , ...

  7. SQL Server A collection of technology insider notes

    SQL Server A collection of technology insider notes The main purpose of this article is to make it easy for you to find my notes entry , For your convenience o(∩_∩)o Microsoft SQL Server 6.5 Technology insider note http://www.cnbl ...

  8. sqlServer2008 Summary of technology insider notes ( Economic sql Methods to summarize )

    over Use of functions : 1. What sum can be achieved based on , Omit group by: select xingming,xingbie,COUNT(*) over() as ' The total number of ' from jbxx_xuesh ...

  9. 【Sql server: T-Sql Technology insider series 】 Index of

    Department of literature T-Sql After reading the technology insider series . Anyone who's ever used a database knows , Index can be greatly optimized sql Statement execution time , But you have to ask me , How to reduce , I can only say :" I'm sorry , I don't know ." With that in mind ...

Random recommendation

  1. oracle Insufficient disk space caused database exception

    oracle Insufficient disk space caused database exception . Need to reduce the size of the data file to solve . 1. Check the name and number of the data file select file#,name from v$datafile; 2. See which data file takes up ...

  2. iOS-NSTimer-pause- Pause - Reference loop

    7 month 26 Daily update : The main purpose of today's update is to suspend !!!! notes : It is not recommended to use , It's not like that. It's wrong , It's because of the code specification , Code should be readable , Following the code is the document , Using pause in teamwork can lead to misunderstandings , It is not necessary to suggest that ...

  3. CCHttpClient launch https request

    Use... In the game http post The request interacts with the server , Any grab will expose the submitted data , Too unreliable , Decided to use some sensitive data in the game https agreement ,HTTPS Agreement is made SSL+HTTP The protocol is built for encrypted transmission . The network of identity authentication ...

  4. WeChat Reply to many pictures and texts With the help of php frame

    private function replyMostPhoto($data,$arr){$this->logger(" We have arrived to reply to many pictures and texts !".$arr[0]['Title'] ...

  5. A little every day Swift( 5、 ... and ) Controller life cycle and SizeClass

    Number of words 358  read 19  Comment on 0  like 0 initialization init-->awakeFromNib--> prepare a segue --> SB To set up outlets --> viewDi ...

  6. boost Kuzhi geometry&lt; Two &gt;

    #include <boost/assign.hpp> #include <boost/geometry/core/point_type.hpp> #include <b ...

  7. Interview skills , How to say database optimization ability through index , Content comes from Java web Lightweight development interview tutorial

    I wrote an article last week , Database interview skills , How to show your ability in building tables , Thanks to the administrator , Put it on the front page , Thanks for your love , In two days, nearly 770 A click on the , Once upon a time 48 Hour hot list . To thank the administrator and everyone for their support , Again ...

  8. Zabbix JMX And tomcat monitor

    working principle : 1.JAVA-GATEWAY  Zabbix It does not support direct monitoring Java, stay zabbix 1.8 before , Only use Zapcat To do agent monitoring , And to modify the source code , Very trouble . All later, in order to solve this monitoring problem ...

  9. C# Points to note when using asynchronous operations ( translate )

    Key points for asynchronous operation Using asynchronous methods to return values should avoid using void For precomputed or simply calculated functions, it is recommended to use Task.FromResult Instead of Task.Run Avoid using Task.Run() Method execution takes a long time to block the thread ...

  10. Python requests-- I'm new to interface automation

    requests Module primary treasure book :http://docs.python-requests.org/zh_CN/latest/user/quickstart.htmlrequests Module of sunflower :http ...