简体   繁体   English

Oracle 12c column_name不一致

[英]Oracle 12c column_name inconsistency

So I have this small problem with Oracle 12c. 所以我对Oracle 12c有这个小问题。 Whenever I do a query like 每当我做一个像这样的查询

SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE table_name = 'EMP';

I get the column names in the right order 我按正确的顺序获取列名称

empno
ename
...

but when I run it again the column names get reversed. 但是当我再次运行它时,列名被颠倒了。

deptno
comm
...
ename
empno

Anyone knows why this happens? 谁知道为什么会这样? Is this a new "feature" implemented in 12c or it's just me that get this the wrong way? 这是一个在12c中实现的新“功能”,还是仅仅因为我的错误方式? And most important is there a way to fix this? 最重要的是有办法解决这个问题吗? Thanks in advance and sorry if this is a dumb question. 如果这是一个愚蠢的问题,请提前致谢并抱歉。

Use 采用

order by column_id;

and you will allways get the right order of columns 并且你总是得到正确的列顺序

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

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