我想使用别名列作为 select 子句中的另一列。
select col_1/col_2+col_3 as new_col,
new_col+10 as new_col_2
from table
Run Code Online (Sandbox Code Playgroud) 我正在查询具有可变长度 JSON 数组的列。
select col.pages[1].name, col.pages[2].name from assoc
Run Code Online (Sandbox Code Playgroud)
当数组中只有一个值时,我收到此错误。
INVALID_FUNCTION_ARGUMENT: Array subscript out of bounds
Run Code Online (Sandbox Code Playgroud)
如果只有一个值,如何防止此错误?