How to get column names in camelcase in Oracle SQL developer

喜你入骨 提交于 2020-07-09 12:06:48

问题


I am trying to run few queries on Oracle SQL developer e.g

Select name AS CandidateName, age AS CandidateAge
from tbl_candidate_details
order by candidate_id desc

But In the result I am getting the column names as "CANDIDATENAME" AND "CANDIDATEAGE".

Is there a way where I can get this as camelcase characters what I have given in the select statement("CandidateName" and "CandidateAge") ?


回答1:


If the column aliases are wrapped in double-quotes, SQL Developer will use those exact values as the column names in the query results:

SELECT name AS "CandidateName", age AS "CandidateAge"
FROM tbl_candidate_details
ORDER BY candidate_id DESC;

Otherwise, the column names in the query results are always displayed in upper case




回答2:


SQL is case insensitive and the SQL standard requires to fold all un-quoted identifiers to uppercase. If you want to preserve the case of your identifiers you need to quote them:

Select name AS "CandidateName", 
       age AS "CandidateAge"
from tbl_candidate_details
order by candidate_id desc


来源:https://stackoverflow.com/questions/41137314/how-to-get-column-names-in-camelcase-in-oracle-sql-developer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!