PDF (美式信紙) - 1.4Mb
PDF (A4) - 1.4Mb
Table.select()
和 collection.find()
使用不同的方法來排序結果。Table.select()
遵循 SQL 語言命名,並將排序方法稱為 orderBy()
。Collection.find()
則不然。使用方法 sort()
來排序 Collection.find()
傳回的結果。在此,與 SQL 標準的接近程度比 API 的一致性更重要。
此函數在 EBNF 中顯示的語法為
TableSelectFunction
::= '.select(' ProjectedSearchExprStrList? ')' ( '.where(' SearchConditionStr ')' )?
( '.groupBy(' SearchExprStrList ')' )? ( '.having(' SearchConditionStr ')' )?
( '.orderBy(' SortExprStrList ')' )? ( '.limit(' NumberOfRows ')' ( '.offset(' NumberOfRows ')' )? )?
( '.lockExclusive(' LockContention ')' | '.lockShared(' LockContention ')' )?
( '.bind(' ( PlaceholderValues ) ')' )*
( '.execute()' )?
此函數在 EBNF 中顯示的語法為
TableInsertFunction
::= '.insert(' ( TableFields )? ')'
( '.values(' ExprOrLiteral (',' ExprOrLiteral)* ')' )+
( '.execute()' )?
此函數在 EBNF 中顯示的語法為
TableUpdateFunction
::= '.update()'
( '.set(' TableField ',' ExprOrLiteral ')' )+ '.where(' SearchConditionStr ')'
( '.orderBy(' SortExprStrList ')' )? ( '.limit(' NumberOfRows ')' )?
( '.bind(' ( PlaceholderValues ) ')' )*
( '.execute()' )?