Hi friends,
i want to write a query to find the total count of records in two tables,
say emp,dept
and the desired out put should be like follows
count(emp.DEPTNO) count(Dept.Deptno)
14 4
but i am getting different result like follows
count(emp.DEPTNO) count(Dept.Deptno)
14 14
can any body tell me how to get the desired result.
its very very urgent
Thanks in advance.
Regards,
Azeez
azeezmsc@gmail.com
Counts of records in Different tables
-
- Posts: 26
- Joined: Fri Nov 10, 2006 3:15 am
- Location: India
SQL> select
2 (select count(*) from emp) emp_cnt,
3 (select count(*) from dept) dept_cnt
4 from dual;
EMP_CNT DEPT_CNT
--------- ---------
14 4
or
SQL> select
2 (select count(*) from emp) || ',' || (select count(*) from dept) "Emp-Dept"
3 from dual
4 /
Emp-Dept
---------------------------------------------------------------------------------
14,4
2 (select count(*) from emp) emp_cnt,
3 (select count(*) from dept) dept_cnt
4 from dual;
EMP_CNT DEPT_CNT
--------- ---------
14 4
or
SQL> select
2 (select count(*) from emp) || ',' || (select count(*) from dept) "Emp-Dept"
3 from dual
4 /
Emp-Dept
---------------------------------------------------------------------------------
14,4
-
- Posts: 26
- Joined: Fri Nov 10, 2006 3:15 am
- Location: India
[quote]SQL> select
2 (select count(*) from emp) emp_cnt,
3 (select count(*) from dept) dept_cnt
4 from dual;
EMP_CNT DEPT_CNT
--------- ---------
14 4
or
SQL> select
2 (select count(*) from emp) || ',' || (select count(*) from dept) "Emp-Dept"
3 from dual
4 /
Emp-Dept
---------------------------------------------------------------------------------
14,4
<i><div align="right">Originally posted by admin
2 (select count(*) from emp) emp_cnt,
3 (select count(*) from dept) dept_cnt
4 from dual;
EMP_CNT DEPT_CNT
--------- ---------
14 4
or
SQL> select
2 (select count(*) from emp) || ',' || (select count(*) from dept) "Emp-Dept"
3 from dual
4 /
Emp-Dept
---------------------------------------------------------------------------------
14,4
<i><div align="right">Originally posted by admin
-
- Posts: 4
- Joined: Wed Nov 08, 2006 6:15 am
- Location: India
Who is online
Users browsing this forum: No registered users and 1 guest