v.21.2New Features

Add sign math function

Add sign math function. #19527 (flynn).
Added the sign math function to ClickHouse.

Why it matters

The sign function provides a simple way to determine the sign of a number, returning -1 for negative values, 0 for zero, and 1 for positive values. This helps users easily classify numbers based on their sign in queries and computations.

How to use it

Use the sign function in your SQL queries by passing a numeric expression as an argument, for example:

SELECT sign(column_name) FROM table_name;