different views [message #300523] |
Fri, 15 February 2008 14:43 |
aarti81
Messages: 235 Registered: December 2007 Location: USA
|
Senior Member |
|
|
Hi
I'm generating a report from a view and i'm getting 22 records, where as another person is generating the same report from another view and he is getting 19 records.My question is even though the views are different we are still accessing the same underlying tables, pls can any one tell why we are getting diff number of records?
Thanks
|
|
|
Re: different views [message #300529 is a reply to message #300523] |
Fri, 15 February 2008 15:06 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Because views are different. So what if underlying tables are the same?
Here's an example, based on 'emp' table of Scott's schema. I'll create two views (as in your case), and - as you've put it - underlying table is the same:SQL> create view v1_emp as
2 select ename, job, sal
3 from emp
4 where deptno = 10;
View created.
SQL> create view v2_emp as
2 select ename, job, sal
3 from emp
4 where deptno = 20;
View created.
SQL> select count(*) from v1_emp;
COUNT(*)
----------
3
SQL> select count(*) from v2_emp;
COUNT(*)
----------
5
SQL>
Did you get familiar with a "view"? Do you know what it is? If not, and search for "view". If you still have a question after reading the documentation, come back and ask. Someone will surely try to help.
|
|
|