Escape column name in query (to avoid conflict with reserved words)

大城市里の小女人 提交于 2019-11-27 08:40:27

问题


I have a Google Sheets and want to query in a column called BY. This is failing:

=query(Data!A:GC, "select BY where BG = 'completed'")

How can I escape that BY column name?


回答1:


Please try backquotes - eg:

=query(Data!A:GC, "select `BY` where BG = 'completed'")  



回答2:


so to use the column BY as an identifier you must use backquotes around it...

`BY`

CREDIT: JAMES @ https://productforums.google.com/forum/#!msg/docs/tFB_02gNceQ/-2IUvmnQBgAJ



来源:https://stackoverflow.com/questions/28048788/escape-column-name-in-query-to-avoid-conflict-with-reserved-words

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!