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

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 ] )*
主站蜘蛛池模板: 琼结县| 景泰县| 凯里市| 武平县| 黄浦区| 奈曼旗| 奎屯市| 高安市| 东山县| 藁城市| 延寿县| 安塞县| 保山市| 罗定市| 将乐县| 榕江县| 烟台市| 开远市| 昔阳县| 日照市| 香格里拉县| 崇州市| 营山县| 双柏县| 丁青县| 梁河县| 龙州县| 舒城县| 进贤县| 锡林浩特市| 自贡市| 西盟| 密云县| 无极县| 万山特区| 定南县| 芜湖县| 马鞍山市| 交城县| 马公市| 汝城县|