📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

MAP_CONTAINS_KEY



Determines whether the specified MAP contains the specified key.

Syntax

MAP_CONTAINS_KEY( <map>, <key> )

Arguments

ArgumentsDescription
<map>The map to be searched.
<key>The key to find.

Return Type

Boolean.

Examples

SELECT MAP_CONTAINS_KEY({'a':1,'b':2,'c':3}, 'c'); ┌────────────────────────────────────────────┐ │ map_contains_key({'a':1,'b':2,'c':3}, 'c') │ ├────────────────────────────────────────────┤ │ true │ └────────────────────────────────────────────┘ SELECT MAP_CONTAINS_KEY({'a':1,'b':2,'c':3}, 'x'); ┌────────────────────────────────────────────┐ │ map_contains_key({'a':1,'b':2,'c':3}, 'x') │ ├────────────────────────────────────────────┤ │ false │ └────────────────────────────────────────────┘

Was this page helpful?