-
Heres a quickie lads,
i have part of a sql statement (below)
where A.object_id(+)=b.id1
what does the (+) mean?????
cant find it anywhere in the books.
Chars
Doug
-
hi there . i think you are asking about the outer joins , it is actually meant to provide the data from the tables , including no similar values from a common coloumn .. you can have more info in any good pl/sql book .
say in the example you had given . the data from the A and B tables will be displayed having common id vales as well as non common values from each table .
-
In this example:
where A.object_id(+)=b.id1
It will include all records which fulfill the join criteria AND all records from table b but no matching record in table a.
i.e. It marks which column can have null data corresponding to non-null calues in the other table
or
where A.object_id=b.id1 (+)
Will do the otherway round - all records matching the join, + records from table a which aren't in table b.
e.g.
select a.dept, b.employee
where a.deptid = b.deptid (+)
could give (departments without employees):
DEPT----EMPLOYEE
1a-------SMITH
2b-------JONES
3a-------
or say to find out which employees don't have a department:
select a.dept, b.employee
where a.deptid (+) = b.deptid
DEPT----EMPLOYEE
1a-------SMITH
2b-------JONES
----------MURPHY
Hope that helps,
Terry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|