AI-generated Key Takeaways
-
This document provides a comprehensive grammar reference for the Search Ads 360 Query Language.
-
The language allows users to query data using a structured syntax including clauses like
SELECT,FROM,WHERE,ORDER BY,LIMIT, andPARAMETERS. -
Various data types like numbers, strings, and lists are supported within the query structure for filtering and data retrieval.
-
Specific operators and functions enable detailed data manipulation, such as date ranges (
LAST_30_DAYS) and pattern matching (REGEXP_MATCH). -
The provided table details the syntax and components of the query language, along with explanations of special characters and usage examples.
The table below contains a complete Search Ads 360 Query Language grammar reference.
SELECT
clause |
SELECT FIELD_NAME (, FIELD_NAME )* |
FROM
clause |
FROM RESOURCE_NAME
|
WHERE
clause |
WHERE CONDITION (AND CONDITION )* |
ORDER BY
clause |
ORDER BY ORDERING (, ORDERING )* |
LIMIT
clause |
LIMIT POSITIVE_INTEGER
|
PARAMETERS
clause |
PARAMETERS LITERAL = VALUE (, LITERAL = VALUE )* |
[a-z] ([a-zA-Z0-9._])*
[a-z] ([a-zA-Z_])*
FIELD_NAME
OPERATOR
VALUE
FIELD_NAME
(ASC | DESC)?
= | != | > | >= | < | <= | IN | NOT IN | LIKE | NOT LIKE | CONTAINS ANY |
CONTAINS ALL | CONTAINS NONE | IS NULL | IS NOT NULL | DURING | BETWEEN |
REGEXP_MATCH | NOT REGEXP_MATCH
LAST_14_DAYS | LAST_30_DAYS | LAST_7_DAYS | LAST_BUSINESS_WEEK | LAST_MONTH |
LAST_WEEK_MON_SUN | LAST_WEEK_SUN_SAT | THIS_MONTH | THIS_WEEK_MON_TODAY |
THIS_WEEK_SUN_TODAY | TODAY | YESTERDAY
LITERAL | LITERAL_LIST | NUMBER | NUMBER_LIST | STRING | STRING_LIST | FUNCTION
[1-9] ([0-9])*
-? [0-9]+ (. [0-9] [0-9]*)?
(' Char* ') | (" Char* ")
[a-zA-Z0-9_]*
( STRING (, STRING )* )
( LITERAL (, LITERAL )* )
( NUMBER (, NUMBER )* )
Key:
-
?indicates an optional element. -
*means zero or more -
+means one or more. -
(xxxxxx)indicates a grouping. -
[a-z0-9]indicates a character range. -
Charindicates any character. -
|stands for "or". - The
REGEXP_MATCHoperator uses RE2 syntax . -
To match a
[,],%, or_literal using theLIKEoperator, surround the character in square brackets. For example, the following condition matches allcampaign.namevalues that start with[Earth_to_Mars]:WHERE campaign . name LIKE '[[]Earth[_]to[_]Mars[]]%'


