I am using column references in a Google Sheets query and realized that column BY (Col #77) breaks my query, as BY is a special word in querying. The solution is to enclose BY in quotations (`BY`) within the query. Today I realized that OR (Col #408) was breaking my query as well. Is there a way I can identify what these words are ahead of time? I'm guessing column AND is also problematic.
Thanks!

In your situation, enclose the area with curly brackets and use ColX.
Example, replace
=query(A:BY,"select A, BY")by=query({A:BY},"select Col1, Col77")Note that x is not an absolute value but relative to the virtual matrix, i.e.
=query({BX:BX,BY:BY,OR:OR},"select Col2, Col3 where Col1 is not null")