sql - 用字符串中的空白替换电子邮件 || 红移
问题描述
我们在 redshift 中有一个表,还有一个包含电子邮件地址的列。如何用空白替换电子邮件地址?
解决方案
您似乎想要一个简单的update
声明:
update mytable set emailid = null
这将设置emailid
为null
表的所有行。null
如果该列已经存在很多行,则where
子句可能会加快速度:
update mytable set emailid = null where emailid is not null
如果要将值设置为空字符串而不是null
:
update mytable set emailid = '' where email is not null and email <> ''
请注意,最后一条语句必须emailid
是字符串数据类型。
推荐阅读
- r - 读取文件并在 R 中提取文本
- javascript - 过滤 Leaflet 中的 geojson 点而不对它们进行聚类
- reactjs - 没有为反应页面设置powershell invoke-webrequest websession?
- openstreetmap - 开放街道地图中的瓷砖样式(带有传单)
- c# - C# Microsoft Bot Framework - 集成 LUIS + QNA +Graph API
- mongoose - neo4j 的模式限制
- google-bigquery - 如何在 Big Query 中为视图命名
- python - Python从两个列表和一个常量中创建元组列表
- docker - Docker-Compose:健康检查脚本(curl),但始终服务(健康:开始)
- java - 迁移到 OpenJDK 10 后,SonarQube 无法在 Jenkins 中工作