Skip to main content

DROP AGGREGATE

Use the DROP AGGREGATE command to remove an existing user-defined aggregate function (UDAF). The usage is similar to DROP FUNCTION, except that it's for aggregate functions.

Syntax

DROP AGGREGATE [ IF EXISTS ] function_name [ ( argument_type [, ...] ) ] ;
Parameter or clauseDescription
function_nameName of the UDAF you want to drop.
( argument_type [ , ... ] )Optional: Argument types of the function.
Specify the argument types when the name of the function you want to drop isn't unique within the schema.
IF EXISTSDo not return an error if the specified function does not exist. A notice is issued in this case.

Usage

A function can be dropped using one of the following methods:

  • Full function signature:

    DROP AGGREGATE function_name ( argument_type [, ...] ); 
  • Function name only, if it's unique in its schema:

    DROP AGGREGATE function_name;

    You can run SHOW FUNCTIONS; to list all existing UDFs to see if a function name is unique.

See also

CREATE AGGREGATE — Create a user-defined aggregate function.

DROP FUNCTIONS — Drop a user-defined function.

Help us make this doc better!