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

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 ] )*
主站蜘蛛池模板: 庆安县| 怀柔区| 绥芬河市| 公安县| 大城县| 崇明县| 宁乡县| 桦南县| 邯郸县| 额济纳旗| 且末县| 浏阳市| 宣城市| 乐东| 武宣县| 罗山县| 六安市| 无为县| 淄博市| 印江| 玛纳斯县| 阿巴嘎旗| 通道| 雅江县| 蓬溪县| 汝阳县| 油尖旺区| 秦安县| 抚松县| 高要市| 逊克县| 新乡市| 冕宁县| 珲春市| 宜阳县| 天门市| 晴隆县| 琼海市| 宾阳县| 当雄县| 南汇区|