In SQL, text strings are sortable objects.This means that they obey ordering rules, such as alphabetical order.Comparison operations can be applied to such text strings (for example, “less than” or “greater than”), where the comparison must apply a certain sort order or collation.For example, the expression “'a' < 'b'
” means that ‘'a'
’ precedes ‘'b'
’ in the collation.The expression “'c' > 'b'
” means that ‘'c'
’ follows ‘'b'
’ in the collation.Text strings of more than one character are sorted using sequential character comparisons: first the first characters of the two strings are compared, then the second characters, and so on, until a difference is found between the two strings.This difference defines the sort order.
A COLLATION
is the schema object that defines a collation (or sort order).