Created
December 12, 2023 04:50
-
-
Save sqlparser/a71c969d20dfbd4615a3ccc976a36c94 to your computer and use it in GitHub Desktop.
Oracle sample SQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```sql | |
CREATE VIEW vsal | |
AS | |
SELECT a.deptno "Department", | |
a.num_emp / b.total_count "Employees", | |
a.sal_sum / b.total_sal "Salary" | |
FROM (SELECT deptno, | |
Count() num_emp, | |
SUM(sal) sal_sum | |
FROM scott.emp | |
WHERE city = 'NYC' | |
GROUP BY deptno) a, | |
(SELECT Count() total_count, | |
SUM(sal) total_sal | |
FROM scott.emp | |
WHERE city = 'NYC') b | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment