Oracle SQL如何导出空值

发布于 2025-01-28 11:00:11 字数 405 浏览 1 评论 0原文

如何将Oracle SQL开发人员输出的记录复制到Excel Sheet

我正在使用Oracle SQL开发人员。我有一些查询在结果网格中获得一些无效的值。我在Excel中剪切/粘贴了这些值,但无效粘贴为空,而不是“零”,因此很难在包含空格的单元格中找到它们。 请问有什么方法可以在Excel中出口为“ null”?

谢谢。

in relation with how to copy the records from output of oracle SQL developer to excel sheet

I'm using Oracle SQL developer. I've some queries which get some null values in the result grid. I'd cut/paste these values in Excel but null are pasted as empty, not as "null", so difficult to find them among cells that contains spaces.
Is there any way to export null as "null" in Excel please?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤独患者 2025-02-04 11:00:11

如果您的列是DataType varchar2的,则:

select case  
            when your_column is null then 'null'
            else your_column  
       end your_column
from your_table;

如果您的列是数字或日期数据类型,则只需使用to_char:

select case  
            when your_column is null then 'null'
            else to_char(your_column) 
       end your_column
from your_table;

If your column is of datatype varchar2 then:

select case  
            when your_column is null then 'null'
            else your_column  
       end your_column
from your_table;

If your column is of number or date datatype then just convert the non null values to string using to_char:

select case  
            when your_column is null then 'null'
            else to_char(your_column) 
       end your_column
from your_table;
甜味超标? 2025-02-04 11:00:11

您有多个选项:

  1. 使用使用为null
  2. 使用 nvl()
  3. 使用decode()decode(< col>,null,'null','null',< col>)代码>

You have multiple options:

  1. Using case with the IS NULL comparison
  2. Using NVL()
  3. Using DECODE() with something like DECODE(<col>, NULL, 'NULL', <col>)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文