官术网_书友最值得收藏!

Cassandra Query Language (CQL)

CQL is very similar to the SQL used in a traditional database, such as MySQL and Postgre. CQL is implemented as an alternative to the traditional RPC interface. It provides a model close to SQL, in the sense that data is put into tables containing rows of columns. For that reason, when used in this chapter these terms (tables, rows, and columns) have the same definitions that they have in SQL. 

CQL appends an abstraction layer that masks the implementation details of its query structure, and presents a native syntax for collections and common encodings. For example, a common syntax for selecting data from a table is given as follows:

select_statement ::= SELECT [ JSON | DISTINCT ] ( select_clause | '*' )
FROM table_name
[ WHERE where_clause ]
[ GROUP BY group_by_clause ]
[ ORDER BY ordering_clause ]
[ PER PARTITION LIMIT (integer | bind_marker) ]
[ LIMIT (integer | bind_marker) ]
[ ALLOW FILTERING ]
select_clause ::= selector [ AS identifier ] ( ',' selector [ AS identifier ] )
selector ::= column_name
| term
| CAST '(' selector AS cql_type ')'
| function_name '(' [ selector ( ',' selector )* ] ')'
| COUNT '(' '*' ')'
where_clause ::= relation ( AND relation )*
relation ::= column_name operator term
'(' column_name ( ',' column_name )* ')' operator tuple_literal
TOKEN '(' column_name ( ',' column_name )* ')' operator term
operator ::= '=' | '<' | '>' | '<=' | '>=' | '!=' | IN | CONTAINS | CONTAINS KEY
group_by_clause ::= column_name ( ',' column_name )*
ordering_clause ::= column_name [ ASC | DESC ] ( ',' column_name [ ASC | DESC ] )*
主站蜘蛛池模板: 钟祥市| 桂平市| 虞城县| 横峰县| 芒康县| 青田县| 安龙县| 常山县| 洛川县| 黄大仙区| 淄博市| 永春县| 泸溪县| 宜君县| 邢台市| 金乡县| 唐山市| 辉南县| 敦化市| 阳新县| 区。| 平泉县| 尉氏县| 鹿邑县| 万载县| 华安县| 新竹市| 邛崃市| 竹溪县| 宾川县| 滕州市| 扬州市| 红桥区| 长白| 长顺县| 涟源市| 洪泽县| 海淀区| 彝良县| 大田县| 台湾省|