Error in query: unexpected input ,. when using LIMIT with offset

620 views
Skip to first unread message

Jurijs P.

unread,
Dec 29, 2021, 4:54:43 AM12/29/21
to AdWords API and Google Ads API Forum
I have a query:

SELECT campaign.id, campaign.name, label.id, label.name, campaign.campaign_budget, campaign.status FROM campaign_label WHERE campaign.status = 'ENABLED' LIMIT 5

which works fine and returns the data I need.
But If I want to use LIMIT with offset, it fails:

SELECT campaign.id, campaign.name, label.id, label.name, campaign.campaign_budget, campaign.status FROM campaign_label WHERE campaign.status = 'ENABLED' LIMIT 0, 5 - this would return "Google Ads failure details: query_error: Error in query: unexpected input ,."

Can't figure out what am I doing wrong?

Thank you

Google Ads API Forum Advisor

unread,
Dec 29, 2021, 9:21:46 AM12/29/21
to jurij.p...@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for reaching out to us.

Note that LIMIT with offset is not a valid LIMIT clause in GAQL. You may use the Query Validator to check if the entered query is valid. For limiting the number of results, you may refer to this guide for more information. Let us know if you have any additional questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 


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