리눅스, 자료실, 성경검색, 추억의게임, 고전게임, 오락실게임, rootman, http://www.rootman.co.kr
* 3.214.184.250 *
| Home | Profile | Linux | 자료실 | zabbix | Mysql 5.6 | 갤러리 | 성경검색 | 해피니스 | 자유게시판 | 게시물검색 | L | O | R |    

 
[sqlite] [sqlite] Assigning Collating Sequences from SQL
 작성자 : rootman
Date : 2011-10-28 11:40  |  Hit : 4,434  

Every column of every table has an associated collating function. If no collating function is explicitly defined, then the collating function defaults to BINARY. The COLLATE clause of the column definition is used to define alternative collating functions for a column.

The rules for determining which collating function to use for a binary comparison operator (=, <, >, <=, >=, !=, IS, and IS NOT) are as follows and in the order shown:

If either operand has an explicit collating function assignment using the postfix COLLATE operator, then the explicit collating function is used for comparison, with precedence to the collating function of the left operand.

If either operand is a column, then the collating function of that column is used with precedence to the left operand. For the purposes of the previous sentence, a column name preceded by one or more unary "+" operators is still considered a column name.

Otherwise, the BINARY collating function is used for comparison.

An operand of a comparison is considered to have an explicit collating function assignment (rule 1 above) if any subexpression of the operand uses the postfix COLLATE operator. Thus, if a COLLATE operator is used anywhere in a comparision expression, the collating function defined by that operator is used for string comparison regardless of what table columns might be a part of that expression. If two or more COLLATE operator subexpressions appear anywhere in a comparison, the left most explicit collating function is used regardless of how deeply the COLLATE operators are nested in the expression and regardless of how the expression is parenthesized.

The expression "x BETWEEN y and z" is logically equivalent to two comparisons "x >= y AND x __EXPRESSION__s of the form "x IN (y, z, ...)" is the collating sequence of x.</P>

Terms of the ORDER BY clause that is part of a SELECT statement may be assigned a collating sequence using the COLLATE operator, in which case the specified collating function is used for sorting. Otherwise, if the expression sorted by an ORDER BY clause is a column, then the collating sequence of the column is used to determine sort order. If the expression is not a column and has no COLLATE clause, then the BINARY collating sequence is used.


 
 

Total. 19
번호 분류 제목 작성자 등록일 조회수
19 sqlite [sqlite3] 날짜와 시간 함수 알아보기 rootman 12-14 10571
18 sqlite [sqlite3] command, DB 전체를 dump export, dump import 하기 rootman 12-12 5035
17 sqlite [sqlite3] command, 외부로 import/export하기 rootman 12-12 4633
16 sqlite [sqlite] 유용한 함수들 rootman 11-22 6987
15 sqlite [sqlite] 반올림, 버림, 올림 함수 rootman 11-22 10781
14 sqlite [sqlite] I deleted a lot of data but the database file did n… rootman 10-28 4365
13 sqlite [sqlite] How do I add or delete columns from an existing tab… rootman 10-28 4353
12 sqlite [sqlite] Collation Sequence Examples rootman 10-28 4608
11 sqlite [sqlite] Assigning Collating Sequences from SQL rootman 10-28 4435
10 sqlite [sqlite] Collating Sequences rootman 10-28 4265
9 sqlite [sqlite] Sorting, Grouping and Compound SELECTs rootman 10-28 4361
8 sqlite [sqlite] Operators rootman 10-28 4252
7 sqlite [sqlite] Comparison Example rootman 10-28 4377
6 sqlite [sqlite] Type Conversions Prior To Comparison rootman 10-28 4408
5 sqlite [sqlite] Affinity Of Comparison Operands rootman 10-28 4435
 1  2  
AND OR