Search by function or task
tee / insights
LEARNING / SQLHOME
SQL / FUNCTION REFERENCE

SQL function map

Find the task. Choose the arguments. Check the result.

SQL

92 analytical SQL topics in 10 categories, with Snowflake and BigQuery differences.

92 / 92 topics
Text / Snowflake

TRIM

Trim both ends

English words and abbreviations

trim = cut away the edges

What is it for?

Clean imported CSV and form values for analysis.

Return valueText

Syntax

TRIM(text[, characters])

What goes in each argument?

ArgumentType / notationExample inputMeaning / default
textRequiredVARCHAR'Ann' / nameThe text to process: a column or string literal.
charactersOptionalVARCHAR' /'Set of characters to trim; default is whitespace/space.

SQL you can run as written

Input data is included. No tables to create.

SELECT
  TRIM('  Ann  ') AS result;

Result of this SQL

result
Ann

Before you use it

Snowflake defaults to ASCII spaces; BigQuery to whitespace. The second argument is a character set, not a substring.

In the other dialect BigQuery

TRIM(text[, characters])

Snowflake defaults to ASCII spaces; BigQuery to whitespace. The second argument is a character set, not a substring.

Official reference ↗