Skip to content

3.4 DML (SELECT)

Peng Ren edited this page Jun 11, 2024 · 8 revisions

Syntax

PyDynamoDB extended SELECT statement of PartiQL.

Please refer to original syntax: PartiQL Select Syntax

SELECT [expression | function(expression)] [alias]  [, ...]
FROM table[.index]
[ WHERE condition ]
[ [ORDER BY key [DESC|ASC]]
  [Limit value]
  [ConsistentRead {True|False}]
  [ReturnConsumedCapacity {INDEXES|TOTAL|NONE}]
...]

Sample

SELECT col1, col2, col3
FROM "Issues"."CreateDateIndex"
WHERE IssueId IN [100, 300, 234]
AND Title = 'some title'
AND Content[0] >= 100
OR contains("Title", 'agile')
ORDER BY IssueId DESC
LIMIT 10
ConsistentRead False
ReturnConsumedCapacity NONE

Data/Datatime & Annotation Functions

Please see this section: Functions

String Functions

Please see this section: Functions

Column Alias in SELECT

Please see this section: Alias

Reference

Please refer to boto3 API: DynamoDB.Client.execute_statement

Clone this wiki locally