Skip to main content

MAP_CONTAINS_KEY

Introduced or updated: v1.2.464

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
└────────────────────────────────────────────┘
Did this page help you?
Yes
No
Explore Databend Cloud for FREE
Low-cost
Fast Analytics
Easy Data Ingestion
Elastic Scaling
Try it today