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

MAP_DELETE



Returns an existing MAP with one or more keys removed.

Syntax

MAP_DELETE( <map>, <key1> [, <key2>, ... ] ) MAP_DELETE( <map>, <array> )

Arguments

ArgumentsDescription
<map>The MAP that contains the KEY to remove.
<keyN>The KEYs to be omitted from the returned MAP.
<array>The Array of KEYs to be omitted from the returned MAP.

Return Type

Map.

Examples

SELECT MAP_DELETE({'a':1,'b':2,'c':3}, 'a', 'c'); ┌───────────────────────────────────────────┐ │ map_delete({'a':1,'b':2,'c':3}, 'a', 'c') │ ├───────────────────────────────────────────┤ │ {'b':2} │ └───────────────────────────────────────────┘ SELECT MAP_DELETE({'a':1,'b':2,'c':3}, ['a', 'b']); ┌─────────────────────────────────────────────┐ │ map_delete({'a':1,'b':2,'c':3}, ['a', 'b']) │ ├─────────────────────────────────────────────┤ │ {'c':3} │ └─────────────────────────────────────────────┘

Was this page helpful?