“-”是什么意思?在oracle输出中?
有时我在输出中得到一个破折号,但我被告知它不是空值,那么它是什么?
选择标题、订单号、状态 来自客户 C、订单 O、书籍 b 其中 b.ISBN=O.ISBN (+) 按标题排序
CUSTOMERS: Column Name Data Type Nullable Default Primary Key CUSTOMER# NUMBER(4,0) No - 1 LASTNAME VARCHAR2(10) Yes - - FIRSTNAME VARCHAR2(10) Yes - - ADDRESS VARCHAR2(20) Yes - - CITY VARCHAR2(12) Yes - - STATE VARCHAR2(2) Yes - - ZIP VARCHAR2(5) Yes - - REFERRED NUMBER(4,0) Yes - -
Sometimes I get a dash in output but I was told it's not a null, so what is it?
select title, order#, STATE
from customers C, ORDERITEMS O, books b
where b.ISBN=O.ISBN (+)
order by title
CUSTOMERS: Column Name Data Type Nullable Default Primary Key CUSTOMER# NUMBER(4,0) No - 1 LASTNAME VARCHAR2(10) Yes - - FIRSTNAME VARCHAR2(10) Yes - - ADDRESS VARCHAR2(20) Yes - - CITY VARCHAR2(12) Yes - - STATE VARCHAR2(2) Yes - - ZIP VARCHAR2(5) Yes - - REFERRED NUMBER(4,0) Yes - -
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果从 Dual 中选择“-”,则输出将为“-”。
如果这不是您正在寻找的答案,请考虑发布您的查询以及相关表的 DDL。
我同意user490735的观点,看起来他的链接有答案。此外,ANSI 连接语法更容易阅读(至少对我来说)。
破折号似乎是外连接中空列的占位符。从长远来看,如果可为空列的默认值实际上是“-”(我不认为是),那么您将在查询结果中得到破折号。
if you select '-' from dual, the output will be "-".
If this is not the answer you are looking for, consider posting your query and maybe the DDL of the table in question.
I agree with user490735, it looks like his link has the answer. Also, ANSI join syntax is mucn easier (at least for me) to read.
The dash appears to be a place holder for null columns in the outer join. As a long shot, if the default value of the nullable columns is actually '-' (I don't think it is) then you will get the dash in your query results.
看起来您发布了“描述”的输出,而不是查询的输出。描述只是告诉您任何列都没有默认值以及哪些列不是主键的一部分。
It looks like you posted the output of a "describe," not the output of the query. The describe is simply telling you there is no default value for any of the columns and which columns are not part of the primary key.