oracle sql concat查询标题

时间:2014-03-10 13:56:01

标签: sql oracle

对于我的数据库课程,我得到了一些sql练习。其中一个是结果:

WHO EARNS WHAT
_____________________
MR MARTIN EARNS 1250 A MONTH

现在我选择了正确的数据,如:

SELECT 'MR ' || ENAME || ' EARNS ' || SAL || ' A MONTH ' FROM EMP WHERE ENAME = 'MARTIN';

但我找不到的是如何将标题置于查询之上?有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

AS "WHO EARNS WHAT"

像这样:

SELECT 'MR ' || ENAME || ' EARNS ' || SAL || ' A MONTH ' 
AS "WHO EARNS WHAT"
FROM EMP WHERE ENAME = 'MARTIN';