Suppose in a well managed successful organization, the HR head decided to reduce the salary by 20% of all the employees just to show that he is something. To know the future salary of the employees working in the dept 114, we have to use a derived column as mentioned in the following query.
SELECT emp_no, dept_no, salary “Actual Salary”,
(Salary * 80/100) “Proposed Salary” <== This is a derived Column
FROM emp
WHERE dept_no = 114
GROUP BY 1,2,3,4
ORDER BY 1, 2
Result:-
|
emp_no |
dept_no | Actual Salary | Proposed Salary |
| 1,100 | 114 | 46,000 | 36,800 |
| 5,000 | 114 | 65,000 | 52,000 |
| 7,000 | 114 | 62,000 | 49,600 |
Popularity: 57% [?]
Our Random Articles
- New Year Wishes 2010
- New Year Wishes
- How to use EXTRACT function with date and time columns
- How to Post on a Separate/New Page in WordPress
- Usage of Macro in Teradata
More Links




No Comment
Popular Articles