Is there some documentation on the LIKE operator?

40 views
Skip to first unread message

Nelson Brochado

unread,
Mar 16, 2023, 5:53:26 AM3/16/23
to Google Ads API and AdWords API Forum
Hi.

I've never used the LIKE operator to filter the content of a query. I think that's what I need, but I'm not sure because I can't find a documentation page that describes it well with examples. Here we have some info, but that's not useful.

So, where can I find the documentation on the LIKE operator? I suppose this operator is used with a regular expression, but there's also REGEXP_MATCH, so that guess is probably wrong. Nevertheless, it seems to accept some special characters, like ], [, %

If there's no documentation on it, can you just explain to me how to use it in all cases? 

Of course, I understand it's used to compare some resource with some string (e.g. to check if a campaign name starts with some string). Well, that's fine, but that's not enough for me to understand if I can use this LIKE operator to match any substring, what the purpose of it really is, and, more importantly, how to use it correctly.

Thanks for the help.

Nelson Brochado

unread,
Mar 16, 2023, 7:44:18 AM3/16/23
to Google Ads API and AdWords API Forum
The solution to my specific problem, i.e. matching using substrings, is to use:

LIKE "%<thesubstring>%".

To note the double quotes and the % around <thesubstring>, which is of course just a placeholder for your actual substring. 

I found this info here: https://chartio.com/resources/tutorials/how-to-implement-sqls-like-operator-in-google-bigquery/, which also contains other useful info.

Google Ads API Forum Advisor

unread,
Mar 16, 2023, 11:41:03 AM3/16/23
to nelson....@webrepublic.ch, adwor...@googlegroups.com
Hello Nelson,

Thank you for raising this concern to the Google Ads API support team.

Regarding your concern, it appears that this is specific to 'LIKE' operator. That said, this Google Ads Query Language Grammar and this Querying in the Google Ads API guides are the guides that we have for this operator. However, please feel free to search some articles, like you provided, that you can refer to using the 'LIKE' operator.

Regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2jzYhg:ref
Reply all
Reply to author
Forward
0 new messages