开发者

WJXBFS1 keyword in Oracle

In one of the Oracle queries, I see something like

SELECT something, sum(1.0) WJXBFS1 FROM some_table

W开发者_StackOverflow中文版hat does this mean?


This is not a keyword, it is an alias for a calculated value so that you can control the field name rather than having Oracle generate one. Otherwise how would you access that field?

Aliasing in Oracle can be done either with or without an "AS" clause, so think of

SELECT something, sum(1.0) WJXBFS1 FROM some_table 

as being the same as

SELECT something, sum(1.0) AS WJXBFS1 FROM some_table 

so you know that you can reference the column holding the value of SUM(1.0) by the name WJBFS1

Incidentally, you can alias any column - not just calculated ones. For example, this would be perfectly legal..

  select a as b, b as a from sometable;

Not saying it would be smart! Just saying that it is legal.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜