简体   繁体   English

如何在 BigQuery 查询中转义双引号?

[英]How to escape a double quote in BigQuery queries?

I wanted to update the strings contain double quote character, so I searched using this BigQuery query我想更新包含双引号字符的字符串,所以我使用这个 BigQuery 查询进行了搜索

select phonenumber from database
where  phonenumber like '%\"%'

but got no result.但没有结果。 Something like '%\\\\"%' didn't work too, but searched for \t character using '%\\\\t%' did work. I don't understand how to properly escape special characters in BigQuery. Please help '%\\\\"%'类的东西也不起作用,但使用'%\\\\t%'搜索\t字符确实有效。我不明白如何在 BigQuery 中正确转义特殊字符。请帮忙

I don't think you need to escape the double quote.我认为您不需要转义双引号。 Doesn't this work?这不行吗?

select phonenumber from database where phonenumber like '%"%'

This is explained in the documentation :在文档中进行了解释

Quoted strings enclosed by single ( ' ) quotes can contain unescaped double ( " ) quotes, as well as the inverse.由单引号 ( ' ) 括起来的带引号的字符串可以包含未转义的双引号 ( " ) 以及反引号。

 "abc" "it's" 'it\'s' 'Title: "Boy"'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM