我试图更新表格,但我得到了这个错误:错误 400:时间戳无效:“2021-03-02 05:34:51.161346 +0000 UTC”,无效查询])如何将其转换为时间戳?代码如下:ctx := context.Background()client, err := bigquery.NewClient(ctx, projectID)if err != nil { return fmt.Errorf("bigquery.NewClient: %v", err)}defer client.Close()q := client.Query("UPDATE myTable SET name = "John Doe", date_updated = TIMESTAMP("2021-03-02 05:34:51.161346 +0000 UTC") WHERE id = 10"
1 回答
慕的地6264312
TA贡献1817条经验 获得超6个赞
尝试
q := client.Query("UPDATE myTable SET name = 'John Doe', date_updated = TIMESTAMP('2021-03-02 05:34:51.161346') WHERE id = 10"
要设置时区使用:+00
q := client.Query("UPDATE myTable SET name = 'John Doe', date_updated = TIMESTAMP('2021-03-02 05:34:51.161346+00') WHERE id = 10"
- 1 回答
- 0 关注
- 95 浏览
添加回答
举报
0/150
提交
取消