gpt4 book ai didi

sql - 如何用NULL替换空格

转载 作者:行者123 更新时间:2023-12-02 11:58:03 25 4
gpt4 key购买 nike

我在 sql server 2012 中有一个列包含空格。我想用 NULL 替换这些空白。我编写了以下查询,但它不起作用。

SELECT replace(COLUMN1, '',NULL) 
FROM Orders;

如何实现上述功能。提前致谢。

最佳答案

使用nullif

select nullif(Column1, '') from Orders

关于sql - 如何用NULL替换空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23710530/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com