What does collation mean?

前端 未结 9 1530
执笔经年
执笔经年 2020-12-04 10:18

What does collation mean in SQL, and what does it do?

相关标签:
9条回答
  • 2020-12-04 11:19

    Collation defines how you sort and compare string values

    For example, it defines how to deal with

    • accents (äàa etc)
    • case (Aa)
    • the language context:
      • In a French collation, cote < côte < coté < côté.
      • In the SQL Server Latin1 default , cote < coté < côte < côté
    • ASCII sorts (a binary collation)
    0 讨论(0)
  • 2020-12-04 11:23

    Collation means assigning some order to the characters in an Alphabet, say, ASCII or Unicode etc.

    Suppose you have 3 characters in your alphabet - {A,B,C}. You can define some example collations for it by assigning integral values to the characters

    1. Example 1 = {A=1,B=2,C=3}
    2. Example 2 = {C=1,B=2,A=3}
    3. Example 3 = {B=1,C=2,A=3}

    As a matter of fact, you can define n! collations on an Alphabet of size n. Given such an order, different sorting routines likes LSD/MSD string sorts make use of it for sorting strings.

    0 讨论(0)
  • 2020-12-04 11:23

    http://en.wikipedia.org/wiki/Collation

    Collation is the assembly of written information into a standard order. (...) A collation algorithm such as the Unicode collation algorithm defines an order through the process of comparing two given character strings and deciding which should come before the other.

    0 讨论(0)
提交回复
热议问题