簡體   English   中英

BIGQUERY:Select 並替換

[英]BIGQUERY: Select and replace

我對 bigquery 很陌生,我希望運行一個查詢,該查詢從 touch_by_bot 為 false 的表中選擇每一行。 然后我想用 true 替換這些相同的行值。

我想出了如何提取錯誤的行,但我不知道如何用 true 替換錯誤值:

'SELECT * FROM ... WHERE touch_by_bot = false'

select * replace(true as touched_by_bot) from ... where touched_by_bot = false

或更新表本身。

create temp table your_table as 
select false as touched_by_bot union all
select true;

update your_table set touched_by_bot = true where touched_by_bot = false;

select * from your_table;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM