Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Using the EXISTS function with PartiQL for DynamoDB

Focus mode
Using the EXISTS function with PartiQL for DynamoDB - Amazon DynamoDB

You can use EXISTS to perform the same function as ConditionCheck does in the TransactWriteItems API. The EXISTS function can only be used in transactions.

Given a value, returns TRUE if the value is a non-empty collection. Otherwise, returns FALSE.

Note

This function can only be used in transactional operations.

Syntax

EXISTS ( statement )

Arguments

statement

(Required) The SELECT statement that the function evaluates.

Note

The SELECT statement must specify a full primary key and one other condition.

Return type

bool

Examples

EXISTS( SELECT * FROM "Music" WHERE "Artist" = 'Acme Band' AND "SongTitle" = 'PartiQL Rocks')
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.