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

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 ] )*
主站蜘蛛池模板: 辽宁省| 博罗县| 双桥区| 麻阳| 习水县| 得荣县| 东海县| 淮南市| 霍邱县| 昌图县| 大宁县| 黑龙江省| 海原县| 麻城市| 潢川县| 舞阳县| 滕州市| 张掖市| 马尔康县| 德昌县| 临江市| 阜新| 柳州市| 麟游县| 军事| 平顺县| 会东县| 峡江县| 兖州市| 永胜县| 磴口县| 涞源县| 闵行区| 大关县| 枣强县| 南丰县| 桃江县| 宜昌市| 四会市| 铜梁县| 平度市|