Create a query that will display the total number of employees and of that total

[复制链接]
查看11 | 回复5 | 2010-2-9 01:01:02 | 显示全部楼层 |阅读模式
There is a question I don't kown how to solve, could you help me?
Q: Create a query that will display the total number of employees and of that total the number who were hired in 1980,1981,1982 and 1983.Give appropriate column headings.
The result like below:
TOTAL 198019811982 1983
-----------
--------------- -------- ---------
14
1 10
2
1
The table is emp which is default in the system.
回复

使用道具 举报

千问 | 2010-2-9 01:01:02 | 显示全部楼层
USE MATRIX
回复

使用道具 举报

千问 | 2010-2-9 01:01:02 | 显示全部楼层
用decode做行转列, 再用sum做人数的计算
回复

使用道具 举报

千问 | 2010-2-9 01:01:02 | 显示全部楼层
我还不大懂decode的语法规则,可以推荐一些关于decode的资料吗?
在网上找了好久都没找到
谢谢!
回复

使用道具 举报

千问 | 2010-2-9 01:01:02 | 显示全部楼层
不会吧, oracle doc是最直接的, 去看看oracle中对内置函数部分的说明,
如果要在网上直接找相关的内容, 你可以去找类似 " 行列转换的帖子或精华贴"
回复

使用道具 举报

千问 | 2010-2-9 01:01:02 | 显示全部楼层
Thanks !
I had found.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行